Jump to content

Getting time()


ayok

Recommended Posts

Hi guys,

 

First, Happy New Year 2009 for all of you. This forum is the best for php.

 

Furthermore, ;D I have question about time(). I have this standard date in Dutch "7 januari 2009". How can I got the time() string for this date?

 

Thank you,

ayok

Link to comment
Share on other sites

No, that doesn't work with other language. I need to convert it to english.

 

I know that with

<?
setlocale(LC_TIME, "nl_NL");
echo strftime("%e %B %G");
?>

I could get "7 januari 2009", but how to get other way around?

Link to comment
Share on other sites

Have a look at strptime(). Doesn't work on Windows platforms. You should be able to feed some of the returned data to strtotime(), and get your timestamp.

 

How is the date string generated? I know it may be a bit late now, but you should really store a timestamp or a date in standard format (2009-01-07) instead of the local date string, and then generate the local string when needed, with strftime("%e %B %G", timestamp).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.