2

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??

hakre
  • 193,403
  • 52
  • 435
  • 836
Diego
  • 16,436
  • 26
  • 84
  • 136

1 Answers1

1

You can use strptime()

Wrikken
  • 69,272
  • 8
  • 97
  • 136
  • 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 Sep 20 '10 at 18:49
  • 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 Sep 20 '10 at 19:24
  • 1
    Careful -- strptime and date_create_from_format use different format strings. – JW. Sep 20 '10 at 20:16
  • @JW: indeed, the `date` vs. `strftime` way, which is indeed worth mentioning. – Wrikken Sep 20 '10 at 20:20