This topic is locked
[SOLVED]

 Setting Date/time Stamp

1/19/2013 10:01:37 AM
PHPRunner General questions
H
herb200mph author

Have two date/time fields in LIST view;
A shows date as: 2013-01-19 09:23:12
B shows date as: 19/01/2013 09:22:49
The code for A is a system generated code and in the correct format.
The code for B is as follows (in the ...edit.php page):
// processing Account Number - end

// THIS LINE ADDS A DATE FIELD

$evalues["DateLastSaved"] = "'".now()."'"; // HOW TO CHANGE DATE FORMAT FOR THIS LINE?????

foreach($efilename_values as $ekey=>$value)

$evalues[$ekey] = $value;
What changes to the .now() line is needed to display the format in the same manner as displayed as A.

C
cgphp 1/19/2013
$evalues["DateLastSaved"] = date("Y-m-d h:i:s");
H
herb200mph author 1/19/2013

Thanks Chjistian!
Will modify that code in a minute.
We do know the PHP syntax for the actual date, etc, but just didn't know how to write the command for it.
Thanks again and will update this posting when successful.


$evalues["DateLastSaved"] = date("Y-m-d h:i:s");


H
herb200mph author 1/19/2013

That did it my friend!
Both dates now read the same.
Of course, being the UK (I'm in the US), they might change the actual format, but will deal with that "when and if."
Thanks again for the prompt reply posting and your assistance.