Search code examples
phpalgorithmdatetimepersian

How algorithm of strtotime(PHP Date function) Works?


  1. i wanna to know how strtotime (php Date function) work?
  2. how Parse string Like "15 September 2012" to timeStamp
  3. is there any better algorithm?

my purpose is changing this function for Persian Language


Solution

  • You can browse the source code of PHP ( https://github.com/php/php-src) and search function to see its implementation.

    UPDATE

    Here is the algorithm of the function strtotime () https://github.com/php/php-src/blob/master/ext/date/php_date.c#L1324

    Regards!.