Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)Display time_added in Event View as MM/DD/YYY
Pages: [1]   Go Down
Print
Author Topic: Display time_added in Event View as MM/DD/YYY  (Read 484 times)
0 Members and 1 Guest are viewing this topic.
Jason S
New Member
*

Karma: 0
Offline Offline

Posts: 3


WWW
« on: August 14, 2007, 03:25:48 PM »

I enabled the field to display in Event View but it shows as a Unix Timestamp.   I want to display MM/DD/YYYY (time of day is not important).   Does anyone have a sub written that will take a Unix time and return MM/DD/YYYY?

Thanks.
Logged
musicvid
New Member
*

Karma: 1
Offline Offline

Posts: 8


WWW
« Reply #1 on: August 14, 2007, 06:35:23 PM »

Well, you could accomplish this using the template variables found in the documentation, but this way is just as easy:

use POSIX qw(strftime);
my @time_added  = gmtime($EVENT->{details}->{time_added});
my $date_added     = strftime("%m/%d/%Y", @time_added);

« Last Edit: August 14, 2007, 06:44:14 PM by musicvid » Logged
Pages: [1]   Go Up
Print
Jump to: