473,395 Members | 1,949 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,395 software developers and data experts.

DATE HELP QUICKLY

i have a site that displays shows. i am getting my date from a mysql
function "CURDATE()" but it give me the date one day ahead of the
actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
what to do but its not hitting the brain right now. and the client
wants a fix asap please help
thanks
Jul 16 '05 #1
3 3150
xe****@aol.com (todd) wrote in
news:4c**************************@posting.google.c om:
i have a site that displays shows. i am getting my date from a mysql
function "CURDATE()" but it give me the date one day ahead of the
actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
what to do but its not hitting the brain right now. and the client
wants a fix asap please help
thanks


Set the time correctly on the server?

More to the point, if the time on the server is out by (say) 16 hours
(because of timezone differences or reading time in GMT or something)
you could always modify it by using SELECT SUBDATE(CURDATE(),INTERVAL 16
HOUR) -- which then returns a full timestamp, so SUBDATE(NOW(),...) may
be more accurate...

Of course, if all you want is to subtract 1 day,
SUBDATE(CURDATE(),INTERVAL 1 DAY) will do it.

Pete.
Jul 16 '05 #2
Peter Jones <jo*****@optushome.com.au> wrote in message news:<Xn*****************************@210.49.20.25 4>...
xe****@aol.com (todd) wrote in
news:4c**************************@posting.google.c om:
i have a site that displays shows. i am getting my date from a mysql
function "CURDATE()" but it give me the date one day ahead of the
actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
what to do but its not hitting the brain right now. and the client
wants a fix asap please help
thanks


Set the time correctly on the server?

More to the point, if the time on the server is out by (say) 16 hours
(because of timezone differences or reading time in GMT or something)
you could always modify it by using SELECT SUBDATE(CURDATE(),INTERVAL 16
HOUR) -- which then returns a full timestamp, so SUBDATE(NOW(),...) may
be more accurate...

Of course, if all you want is to subtract 1 day,
SUBDATE(CURDATE(),INTERVAL 1 DAY) will do it.

Pete.


you are an absoulte life saver THANKS!!!
Jul 16 '05 #3
xe****@aol.com (todd) wrote in
news:4c**************************@posting.google.c om:
you are an absoulte life saver THANKS!!!


No problem,
Pete.
Jul 16 '05 #4

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

Similar topics

3
by: Darren | last post by:
Hello, How would I write in SQL or ASP the following?: Count number of Database Records between NOW and 24 HOURS EARLIER? I know how to retrieve recordsets etc - its just the date thing I cant...
8
by: peashoe | last post by:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them...
4
by: ianv2 | last post by:
Hi Is the following possible using Javascript ? I would like a page to redirect to another page if the page expiry has passed. E.G. If my questionnaireform.html page had an expiry date...
3
by: andrew | last post by:
Hi: I am already using TreeMap to massage records in my export file such that each record has a unique key combination ( LastName + FirstName + Member Key) . Thus I am sorting the records by...
3
by: hasanainf | last post by:
Hi all, What will be the best database design for an inventory control that uses expiry date for its products. Over a period of time, a particular product will have many expiry date and that...
12
by: Diego | last post by:
Can I validate (possibly with a compare validator) a Date entered by the user based upon his regional settings? I.e. if a user is american the format would be mm/dd/yyyy, if brittish dd/mm/yyyy...
1
by: Wayne | last post by:
Hi all I'm trying to calculate the number of days (or workdays) between 2 given dates that do not include weekend days or public holidays (public holidays are user defined from a dbase, have a...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
6
by: vdicarlo | last post by:
I am a programming amateur and a Python newbie who needs to convert about 100,000,000 strings of the form "1999-12-30" into ordinal dates for sorting, comparison, and calculations. Though my script...
9
by: Martin | last post by:
I'm retrieving some records from a database. One of the fields contains a date/time. I would like to format it as I send it out to the table in the displayed page. Can some one please tell me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.