473,327 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Problem with date()

Can anyone help?

Here is what I have (part, at least)

echo $dbResult[$i]["sender"] . ' ' . $dbResult[$i]["subject"] . ' ' .
$dbResult[$i]["timestamp"] . " " .
date("M j, Y, g:i a", $dbResult[$i]["timestamp"]) . '<br>';
Here is what it puts out (formatted here to make it easier for you to read)

NumEmail = 3
sheldonlg Third message 20050720060604 Jan 18, 2038, 9:14 pm
sheldonlg Long text 20050719200450 Jan 18, 2038, 9:14 pm
sheldonlg est 20050719200127 Jan 18, 2038, 9:14 pm
Why, for different timestamps, is it different?
Jul 21 '05 #1
3 1471
>Here is what I have (part, at least)

echo $dbResult[$i]["sender"] . ' ' . $dbResult[$i]["subject"] . ' ' .
$dbResult[$i]["timestamp"] . " " .
date("M j, Y, g:i a", $dbResult[$i]["timestamp"]) . '<br>';
Here is what it puts out (formatted here to make it easier for you to read)

NumEmail = 3
sheldonlg Third message 20050720060604 Jan 18, 2038, 9:14 pm
sheldonlg Long text 20050719200450 Jan 18, 2038, 9:14 pm
sheldonlg est 20050719200127 Jan 18, 2038, 9:14 pm
Why, for different timestamps, is it different?


Is *WHAT* different? The subject line?
The last field you printed ISN'T different for the 3 messages.
Did you leave the word NOT out of the question?

date() takes a UNIX timestamp as a second argument. What you have
printed in the third column (and fed as a second argument to date()
is not a UNIX timestamp and won't fit in 32 bits, so it overflowed.

Gordon L. Burditt
Jul 21 '05 #2

"Gordon Burditt" <go***********@burditt.org> wrote in message
news:11*************@corp.supernews.com...
Here is what I have (part, at least)

echo $dbResult[$i]["sender"] . ' ' . $dbResult[$i]["subject"] . ' ' .
$dbResult[$i]["timestamp"] . " " .
date("M j, Y, g:i a", $dbResult[$i]["timestamp"]) . '<br>';
Here is what it puts out (formatted here to make it easier for you to
read)

NumEmail = 3
sheldonlg Third message 20050720060604 Jan 18, 2038, 9:14 pm
sheldonlg Long text 20050719200450 Jan 18, 2038, 9:14 pm
sheldonlg est 20050719200127 Jan 18, 2038, 9:14 pm
Why, for different timestamps, is it different?
Is *WHAT* different? The subject line?
The last field you printed ISN'T different for the 3 messages.
Did you leave the word NOT out of the question?


Yes, I did leave out NOT.
date() takes a UNIX timestamp as a second argument. What you have
printed in the third column (and fed as a second argument to date()
is not a UNIX timestamp and won't fit in 32 bits, so it overflowed.


If that is not the unix timestamp, but is the timestamp that appears when I
insert in the MySQL database, how do I get the unix timestamp from that?

Shelly
Jul 21 '05 #3
In article <ha********************@comcast.com>,
Shelly <sh************@asap-consult.com> wrote:

"Gordon Burditt" <go***********@burditt.org> wrote in message
news:11*************@corp.supernews.com...
>Here is what I have (part, at least)

echo $dbResult[$i]["sender"] . ' ' . $dbResult[$i]["subject"] . ' ' .
$dbResult[$i]["timestamp"] . " " .
date("M j, Y, g:i a", $dbResult[$i]["timestamp"]) . '<br>';
Here is what it puts out (formatted here to make it easier for you to
read)

NumEmail = 3
sheldonlg Third message 20050720060604 Jan 18, 2038, 9:14 pm
sheldonlg Long text 20050719200450 Jan 18, 2038, 9:14 pm
sheldonlg est 20050719200127 Jan 18, 2038, 9:14 pm
Why, for different timestamps, is it different?


Is *WHAT* different? The subject line?
The last field you printed ISN'T different for the 3 messages.
Did you leave the word NOT out of the question?


Yes, I did leave out NOT.
date() takes a UNIX timestamp as a second argument. What you have
printed in the third column (and fed as a second argument to date()
is not a UNIX timestamp and won't fit in 32 bits, so it overflowed.


If that is not the unix timestamp, but is the timestamp that appears when I
insert in the MySQL database, how do I get the unix timestamp from that?


select unix_timestamp(stamp) from wristwatch;

Gordon L. Burditt
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Aing | last post by:
Anyone knows what can be cause of this problem? //////////////////////////////////////////////////////////// typedef struct _date_struct { int date,month,year; }date_struct; Class Date {...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
6
by: jstaggs39 | last post by:
I want to create a Dcount and an If...Then...Else statement to count the number of records in a table based on the date that is entered to run the form. The If....Else statment comes in because if...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
11
by: Geoff Jones | last post by:
Hi I have a table that has a column with Date types. I am trying to view certain rows in the table using a DataView. Using the filter, I can view the rows with, for example, the date equal...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
8
by: sara | last post by:
I have a report that runs fine with data. If there is no data, I have its NO Data event sending a MsgBox and cancelling the report. Then it seems I still get the 2501 message on the Open Report...
2
osward
by: osward | last post by:
Hello there, I am using phpnuke 8.0 to build my website, knowing little on php programing. I am assembling a module for my member which is basically cut and paste existing code section of...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
11
by: jessy | last post by:
Hi, I have a problem with my DateTimePicker javascript code which i downloaded , the problem is when i pick the date and the date appears in my Text Field and i click Submit the date which i picked...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.