Hi,

Is there a way to convert the date/time format of the created date to something readable. I want open it in excel or access but I can't find out how to convert the 10 digit number to a readable date/time format.

I noticed that the 10 digit numbers are seconds, and the clock is started in 1970 and this 10 digit number is added to it but how can I convert it in something readable.

Gert Jan.

Comments

gordon’s picture

The best method to use is the standard drupal format_date() which also handles timezones.
But the core of this is is the php function gmdate() or you could use date().
See gmdate() or take a look at the format_date() function in includes/common.inc

--
Gordon Heydon

Marco Palmero’s picture

Wow this is an old thread...

I've been searching for the same thing.

How can I convert numbers like these:
1135305684
1135305905

Into readable format in excel?

Im aware its related to:
http://api.drupal.org/api/function/format_date/6

But not too sure...

Thanks

tevih’s picture

I was wondering this myself. Your link educated me. For example, let's say your 1135305684 date:

print format_date(1135305684, $type = 'small', $format = '', $timezone = NULL, $langcode = NULL) ;