Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Pozivanje samo datuma

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
BInE



Joined: 08 Apr 2009
Posts: 58

PostPosted: 07.05.2009 07:14    Post subject: Pozivanje samo datuma Add user to your forum ignore list Reply with quote

Pozz svima,

u bazi sam postavio jednu kolonu u koju ce se unosti datum, eh taj datum kada treba da se prikaze na stranici tada se prikazuje i vrijeme , npr:"0:00:00", koje se nije nigdje zadalo,

kako sada da mi se to vrijeme ne pokazuuje zanima me samo datum (jer samo njega korisnik unese u bazu).

hvala
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 07.05.2009 08:30    Post subject: Add user to your forum ignore list Reply with quote

Mozes:

- promjeniti definiciju kolone u bazi da bude "date" umjesto "datetime"

ili nesto od navedenog, sve ima isti / slican rezultat, ali je put drugaciji Smile

Code:

echo date('d.m.Y', strtotime($db_row['datum']));

Code:

echo substr($db_row['datum'], 0, 10);

Code:

$date_array = explode('-', $db_row['datum']);
echo $date_array[2] . '.' . $date_array[1] . '.' . $date_array[0];

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
snyder



Joined: 21 Dec 2005
Posts: 57
Location: Zagreb

PostPosted: 07.05.2009 10:21    Post subject: Add user to your forum ignore list Reply with quote

a možeš i staviti int (11) na kolonu u tablici i spremati time() u nju.

kasnije lako konventiras sa date()
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
gorrc



Joined: 12 Jul 2007
Posts: 87

PostPosted: 07.05.2009 19:28    Post subject: Add user to your forum ignore list Reply with quote

snyder wrote:
a možeš i staviti int (11) na kolonu u tablici i spremati time() u nju.

kasnije lako konventiras sa date()


Ja bi izbjegao ovakav način rada jer ako je nešto datum onda je bolje da i bude datum u mysql jer nikad neznaš kad će u budućnosti trebati opercije sa datumom u bazi.

_________________
www.topnogomet.com -- http://www.gorrc.blogspot.com/ - http://code.google.com/p/bet-script/
Back to top
View user's profile Send private message
Moebius



Joined: 26 Jan 2004
Posts: 245
Location: zagreb

PostPosted: 07.05.2009 22:11    Post subject: Add user to your forum ignore list Reply with quote

A mozda covjek radi u asp.net-u?

Code:

Dim dt as DateTime = now()
response.write(dt.ToString("MMM dd, yyyy"))



ili mozda ovako, pa formatiras onako kako ti hoces
Code:

Public Function getDateFromDateTime(byval dt as DateTime) as String
   return day(dt) & "." & month(dt) & "." & year(dt)
End Function


gdje dt moze biti i nesto iscitano iz baze.
Back to top
View user's profile Send private message Visit poster's website
BInE



Joined: 08 Apr 2009
Posts: 58

PostPosted: 07.05.2009 23:29    Post subject: Add user to your forum ignore list Reply with quote

hvala, to je to
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group