I’m wondering which Codeigniter function would be the best function to use for the gmdate php function.
The purpose of this is taking a string unix timestamp and formatting it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have options. You can simply use original PHP function like this:
Or you can utilize
now()function in date helper of CI, but by doing this you need to first set yourdate_referenceof config togmt:And call it like this:
Since now() returns the current time as a Unix timestamp, referenced either to your server’s local time or GMT, based on the “time reference” setting in your config file.