Using date()?

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
Gleasonator
Registered User
Posts: 652
Joined: Tue Jun 05, 2007 2:19 pm
Location: Texas
Contact:

Using date()?

Post by Gleasonator »

Hi,

I'd like a bit of text to display the time using date('H:i'), which would make the text display in military time with leading zeros. From what I understand, however, I'm supposed to use $user->format_date() around this so that it will fix the time according to the time zone that the user has selected. If I am correct, how should I go about doing this?

Putting simply $user->format_date(date('H:i')) returns the date like CURRENT_DATE does.

Any help on this would be appreciated.
Sorry for my bad Engrish !
gleason|design

Image
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Using date()?

Post by A_Jelly_Doughnut »

The second argument of $user::format_date() is a date format.

$user->format_date(time(), 'H:i');
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
Gleasonator
Registered User
Posts: 652
Joined: Tue Jun 05, 2007 2:19 pm
Location: Texas
Contact:

Re: Using date()?

Post by Gleasonator »

Thank you. :) Works perfectly.
Sorry for my bad Engrish !
gleason|design

Image
Locked

Return to “[3.0.x] MOD Writers Discussion”