Hi!
I have a form that saves data to a database table. I use created:{date:Y-m-d H:i:s} in the field 'Data override on Insert'. This inserts the current date/time in the database table. Works fine, but I was wondering if it is possible to save this date/time in our own timezone?
Kind regards,
Jip
I have a form that saves data to a database table. I use created:{date:Y-m-d H:i:s} in the field 'Data override on Insert'. This inserts the current date/time in the database table. Works fine, but I was wondering if it is possible to save this date/time in our own timezone?
Kind regards,
Jip
Hi Jip,
Its better to save the time in GMT but display it later in whatever timezone you want:
Best regards,
Max
Its better to save the time in GMT but display it later in whatever timezone you want:
{date.-0500:Y-m-d H:i:s$(data:time)}
Best regards,
Max
OK, thanks for this Max.
We store this value in the database (GMT - default) but after this we extract the data to a csv file. In the CSV file I would like to have the 'local' time, so that's the 'display' part of the date. I don't think it is possible to do this in the CSV export settings?
It would be best to actually use the timezone set in Joomla to 'display' the dat in the CSV file. Maybe there would be a way to convert the date between saving it in the database and exporting it to the CSV? But that would make it a quit more complex I guess.
I could also just let the client know he has to be aware the time in the CSV is GMT ;-) It's not a big deal!
Thanks so far!
We store this value in the database (GMT - default) but after this we extract the data to a csv file. In the CSV file I would like to have the 'local' time, so that's the 'display' part of the date. I don't think it is possible to do this in the CSV export settings?
It would be best to actually use the timezone set in Joomla to 'display' the dat in the CSV file. Maybe there would be a way to convert the date between saving it in the database and exporting it to the CSV? But that would make it a quit more complex I guess.
I could also just let the client know he has to be aware the time in the CSV is GMT ;-) It's not a big deal!
Thanks so far!
Hi Jip,
You can modify the date before the data is added to the CSV using some PHP code, but the better here is to tell the client that dates are in GMT time, maybe they need to import it later into database ?
Best regards,
Max
You can modify the date before the data is added to the CSV using some PHP code, but the better here is to tell the client that dates are in GMT time, maybe they need to import it later into database ?
Best regards,
Max
I think we'll just leave it as it is and tell the client the have dot the math themselves for now ;-) And indeed, if they ever need to import this in to a database this will keep it GMT.
Thanks Max.
Thanks Max.
Hi Jip,
No problems!
Best regards,
Max
No problems!
Best regards,
Max
I'm loving your forums! Thank you for all you do. I was trying to time-stamp my email template and from this thread, I came up with this:
This works great for me but I took your code to make it so I wanted to say thank you!
-Sandman
Submitted by: <b>{ip:}</b> on <b>{date.-0500:F jS, Y}</b> at <b>{date.-0500:g:ia$(data:time)}</b> EST
This works great for me but I took your code to make it so I wanted to say thank you!
-Sandman
This topic is locked and no more replies can be posted.