format of addtime and logintime in database
Hello to all!
I have a doubt:
In that format are stored the dates in mysql database for the singnup table in addtime and logintime fields?
Example:
addtime: 1213704417
logintime: 1226199785
How I can convert this in a normal format for see this in a page?
Re: format of addtime and logintime in database
They are in Epoch time. You can use an Epoch converter (search google) to convert them into a readable date and time. Or, are you looking to build a page to display them?
Re: format of addtime and logintime in database
Quote:
Originally Posted by pocholo
Example:
addtime: 1213704417
logintime: 1226199785
addtime: 1213704417 translates to Tuesday, June 17th 2008, 12:06:57 (GMT)
logintime: 1226199785 translates to Sunday, November 9th 2008, 3:03:05 (GMT)
This page does it for you:
http://www.4webhelp.net/us/timestamp.php
I find I have to use it all the time so that I can publish archived videos on the front page.
It's a pain in the ass, and I hope it's fixed in the next version
Re: format of addtime and logintime in database
From a programming standpoint, you would want it to be in Epoch as it is now. Are you manually publishing your archived videos to your main page or are you trying to do it via an automated mean? PHP can convert the time for you on the fly if you are wanting to do it via an automated process.
Re: format of addtime and logintime in database
Thanks for the information, but what is the php function to capture the Epoch time at logintime field, and convert this to an normal date?
And how I can integrate this into a Vshare tpl?
Re: format of addtime and logintime in database
It would be easier if you tell me what you are trying to accomplish as how you want the date to look (for example, MM-DD-YYY, etc). This way, I could give you a template code that you could just insert into whatever page.
Re: format of addtime and logintime in database
Well, I referred to the same format that this is in the user profile.
Example:
last login: 28 minutes ago
last login: 1 day ago
Re: format of addtime and logintime in database
Ok. I still need to know how you are planning to use it. I can give you the code to convert the date, but it will not work unless I know how you wanting to get the date into it.
Re: format of addtime and logintime in database
Hi, Bplex!
I have a list of my users (you know this :wink: ), and I want his last login date in the mentioned format.
Nobody knows how to convert epoch and show this in Vshare template?
Re: format of addtime and logintime in database
Nobody can help me with this topic?
Re: format of addtime and logintime in database
Thank you very much for your help, bplex.
It works perfectly.
Re: format of addtime and logintime in database