Re: Date Field/PHP conversion
Title: Date Field/PHP conversion ** Brad, If you need to convert an integer value from a Date field in Remedy to a PHP date, you should be able to use the "cal_from_jd" function. $phpdate = cal_from_jd($remedydate, CAL_GREGORIAN); This returns an array of values related to the given date. See http://us2.php.net/manual/en/function.cal-from-jd.php for more details. The "jdtounix" and "unixtojd" functions may also be useful, depending upon what type of conversion you are attempting. HTH, Thomas - Original Message - From: Brad Welch Newsgroups: gmane.comp.crm.arsystem.general Sent: Tuesday, September 26, 2006 13:22 Subject: Date Field/PHP conversion ** Remedy's Date Field doesn't use any kind of conventional timestamping that PHP provides does anyone know of a converstion script/function for PHP to remedy's Date field? Thanks in advance for any help. ARS 5.1.2 SQL 2000 Server Windows 2K __20060125___This posting was submitted with HTML in it___ __20060125___This posting was submitted with HTML in it___
Re: Date Field/PHP conversion
Here is how you convert the Date field in PHP: # $arrivaltimestamp is set to value of datetime field from DB $arrivaldatetime = date("m/j/y g:i a",$arrivaltimestamp); # $arrivaldatetime will be formatted like '9/26/04 2:49 PM' As a bonus, here is how to convert Diary fields in PHP: # $worklog is set to value of diary field from the DB $array_of_diary_entries = explode('', $worklog); foreach ($array_of_diary_entries as $i) { $array_of_entry_parts = explode('', $i); $date = date('m/j/y g:i:s a', $array_of_entry_parts[0]); if ($array_of_entry_parts[1] != "") { print "Date -- $date \n"; print "User -- {$array_of_entry_parts[1]} \n"; print "Diary Entry -- {$array_of_entry_parts[2]} \n"; } } Bob Palma [EMAIL PROTECTED] CIBER, Inc. 732-623-5465 Direct 732-225-1700 Main Number From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Brad Welch Sent: Tuesday, September 26, 2006 2:23 PM To: arslist@ARSLIST.ORG Subject: Date Field/PHP conversion ** Remedy's Date Field doesn't use any kind of conventional timestamping that PHP provides... does anyone know of a converstion script/function for PHP to remedy's Date field? Thanks in advance for any help. ARS 5.1.2 SQL 2000 Server Windows 2K __20060125___This posting was submitted with HTML in it___ ___ UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org
Date Field/PHP conversion
Title: Date Field/PHP conversion ** Remedy's Date Field doesn't use any kind of conventional timestamping that PHP provides… does anyone know of a converstion script/function for PHP to remedy's Date field? Thanks in advance for any help. ARS 5.1.2 SQL 2000 Server Windows 2K __20060125___This posting was submitted with HTML in it___