With php 5.3 using the datetime class would be a solution.
$date = "08/04/2011"; // Datepicker format
$obj = DateTime::createFromFormat('d/m/y', $date);
$timestamp = $obj->getTimestamp();
Thank you for your attention.
by using datetime class still the problem is remained.
The problem is:
1- we (persian/arabic community) use local date format (Hegira date not Gregorian date)
2- we (persian/arabic community) use local numbers (Not latin 0123456789)
And php functions can not handle local dates and local numbers.
Currently we have "formatTimestamp" function for output date/time and we fully customize it for our needs.
so we have to define a xoops function
for input date/time.
we should do the same localization as has been done for formatTimestamp.Add the function (strtotime / createFromFormat / Xo_strtotime, ANYTHING YOU LIKE) to xoopslocal class.
Then we can use the same procedure: extending the function abilities in languages/OUR_LANG/locale.php)
we just need a function in xoopslocal class. Therefore it is up to developers to define a new xoops function from scratch like formatTimestamp or add the already php functions (strtotime / createFromFormat) like number_format to xoopslocal class.
Also the next most important step is forcing all module/core developers to unify
their methods for getting the date/time from user (use THAT XOOPS FUNCTION just like using the formatTimestamp)
We can hack every modules and every core and add our above mentioned needs but i want to prevent this kind of localization (hard code and hack).
I can not see any change here:http://xoops.svn.sourceforge.net/view ... &view=markup&pathrev=9738
From In the middle of nowhere
Community Coordinator (temporary)