tags:

views:

42

answers:

1

Hello.

The title says all I want to know. Is there any function or I have to make it myself?

Thanks!

Edit:

Ok. Thats great, in the server I'm developing for it works just perfect. But in my computer where the development server is hosted I'm using windows.

strptime -> Note: This function is not implemented on Windows platforms.

Is there any other solution compatible with: linux PHP 5.2.4 and windows PHP 5.3??

+1  A: 

You can use strptime()

Wrikken
strptime function returns an array, is there any way to convert the array to a date time object or any contructor of DateTime wich recieves an array?
Diego
Sure, just use `mktime()` on it, or reformat it to something `strtotime()` or `DateTime::__construct();` understands, etc. Multiple possibilities, but no 'one go' afaik, you'll have to write it out.
Wrikken
Careful -- strptime and date_create_from_format use different format strings.
JW
@JW: indeed, the `date` vs. `strftime` way, which is indeed worth mentioning.
Wrikken