![]() |
Timestamp help
A few questions with Linux timestamps.
How do you insert them into mySQL, using time(), date() or just an empty row? My timestamps are looking like this: 20050302171707 - while this looksaccurate seeing as how it is 2005 - 3rd month - 2nd day, my friend saysthat is completely inaccurate. He then pointed me to this link to proove himself correct. So what's the deal....:ermm: |
to insert a timestamp into SQL you need to escape it as with any variable really but just use
PHP Code:
|
Thanks, I'll give this a shot.
So is the timestamp I am currently getting a crazy coincidence? Or just a unusable timestamp? |
Your timestamp is formatted with separate fields. A UNIX timestamp (seconds since January 1st, 1970) is only a scalar value.
|
Well I tried your suggestion - and read a thread about iton filburts website - no luck yet. I checked the field type andit is TIMESTAMP(14). I tried '" . TIMENOW . "' with and withoutthe single quotes, I get different values for each. I even triedinserting the value a few ways into phpMyAdmin (even the UNIX_TIMESTAMPfunction) - still got the number below.
I think with the single quotes I'd get no value returned (000...) and without I'd get 20001112070437. Any more info needed to sort this out let me know. It's really buggin me.:ermm: |
you can just use time() if you're running the query straight but you'll even need to escape that
here's an example of entering this query PHP Code:
|
Query:
PHP Code:
20001112072628 :ermm: |
that be the case what's the problem?
|
converted "20001112072628" to..
19 January 2038 03:14:07 AM ^^ problem, unless I've been asleep for a few years |
ooooooh, major crash and burn
you sure the time is correct on your server? |
All times are GMT. The time now is 05:57 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|