Gossamer Forum
Quote Reply
Removing Time from Dates
Heya all,

I'm looking for a way to remove the time from <%user_last_logon_date%> and <%user_registered_date%>.

Would like to display:
Apr 6, 2004, 5:22 AM

as:
Apr 6, 2004

Both these tags are on the user_view.html templeate.

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Removing Time from Dates In reply to
I think you'll need to use date_transform - something like this (but I can't remember all the codes for the dates and times - you'll need to look up the AM,PM one at least).

<%GT::Date::date_transform($fieldname,'%mmm% %d% %yyyy%, %hh%:%MM%','%mmm% %d% %yyyy%')%>
Quote Reply
Re: [afinlr] Removing Time from Dates In reply to
Thanks! Got it. To include the am/pm it should look like this:

<%GT::Date::date_transform($user_registered_date,'%mmm% %d%, %yyyy%, %h%:%MM% %tt%','%mmm% %d% %yyyy%')%>

Safe swoops
Sangiro