Sebastian
|
| Posted: 09/30/2002, 10:05 AM |
|
Hello
I have big problems with some Before Update Event. I have a field called $flddatum. i let a javascript write some date in it (the tigra applet) with the format 18,45,14,9,19,2002. Now i want to make a Unix timestamp for this date, so i go on and put at the Before Update Event this little piece of code:
$flddatum = mktime($flddatum);
but i become the timestamp for the actual date and not the date given in the $flddatum variable. When i use $flddatum = mktime(18,45,14,9,19,2002); directly in the Before Update Event, all works fine.
Whats the problem or my failure ?
|
|
|
 |
Nicole
|
| Posted: 10/02/2002, 11:38 PM |
|
Sebastian,
in case the value of $flddatum is the one that was created with JS function, the mktime() won't accept it. Look at mktime() function description in PHP manual:
int mktime (int hour, int minute, int second, int month, int day, int year [, int is_dst])
all parameters are of int type. While $flddatum is one variable of string type.
You should split the string into separate int variables, then use them in mktime(). Use e.g. PHP split() function for it. Here is its description: http://www.php.net/manual/en/function.split.php
|
|
|
 |
|