Page 1 of 1

Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 8:03 am
by sing2trees
Hi,

I have a date of birth field in the self-registration module.

When a user signs up, they enter their date of birth, however whenever I export the data (from the Admin section of Frontend User Management), the date of birth only shows as numbers.

Ie:
17th February 1983 exports as:
414288000

Does anyone know how I can fix this?

Thanks in advance!

Re: Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 1:54 pm
by jmcgin51
The stored value is a Unix timestamp.  You need a script to convert it to a m/d/y format.

http://www.onlineconversion.com/unix_time.htm
http://www.unixtimestamp.com/index.php

Re: Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 2:04 pm
by calguy1000
use the cms_date_format smarty modifier that is included with CMS Made Simple.

Re: Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 2:09 pm
by sing2trees
calguy1000 wrote: use the cms_date_format smarty modifier that is included with CMS Made Simple.
Hi - where abouts do I find this?

Thanks in advance!

Re: Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 2:17 pm
by jmcgin51
something like this

{$yourdatetimevariable|cms_date_format} //will output the default date/time as you specified in the admin panel (Global Settings > General Settings)

or
{$yourdatetimevariable|cms_date_format:"%d-%m-%Y"} //will output the date/time in the format specified in the tag

http://php.net/strftime

Re: Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 2:22 pm
by sing2trees
The way I set this up was using the self registration module - so where would I add the code to convert it?

Sorry for all the questions - I really appreciate everyones help

Re: Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 3:53 pm
by Jeff
This is an issue with the Export function in FEU not in the Self Registration module.

Re: Self Registration - Date showing as unreadble numbers only

Posted: Tue Jul 28, 2009 4:55 pm
by jmcgin51
It sounds like you want the FEU export feature to export the date in a "human-readable" format.  You can submit a feature request for FEU in the Forge.

Until that feature is implemented, you will need to run a formula on that CSV field (after the export is complete) to convert Unix to time/date.

Here is a link to get you started:
spreadsheetpage.com/index.php/tip/converting_unix_timestamps/