I'm using FormatDateTime(Now) on a form to include when the form was submitted. The problem is that my time zone is 1 hour ahead of the time zone in which my server is located. Is there an easy way to increase the hour by +1?
I have a field in my database that records the date/time of various events in the usual format of dd/mm/yyyy/. I need to display this field on my asp page in a string format.
Is there another function out there that does the opposite of the cdate function?
I have tried using the FormatDateTime to convert, but without any luck?
I set my computer Regional Setting (Control Panel - Regional and Language Options - Customize - Date) to dd/mm/yy. In my ASP page I do the following:
FormatDateTime("1/20/07",2)
and it returns 1/20/07 instead of 20/1/07. I though my setting it to 2, it will display a date using the short date format specified in your computer's regional settings, how come it is not ? How can I set the string to display a date using the computer's regional setting ? IIS is running on my machine, I am not on a network, it is just my machine.
I set my computer Regional Setting (Control Panel - Regional and Language Options - Customize - Date) to dd/mm/yy. In my ASP page I do the following:
FormatDateTime("1/20/07",2)
and it returns 1/20/07 instead of 20/1/07. I though my setting it to 2, it will display a date using the short date format specified in your computer's regional settings, how come it is not ? How can I set the string to display a date using the computer's regional setting ?
I have a simple four line bit of code in a page on my web site that gets today's date, formats it (FormatDateTime(thedate,2), and compares it to a date drawn from a database which is formatted the same way, and then if the two match, writes a message on the page.
Dates in this format work just fine: Jun 09 1975 12:00AM
However, most dates in the database are in this format:
Monday, June 09, 1975 12:00:00 AM and I get Data Type Mismatch errors from those when it tries to format the date. Evidently, it doesn't think this is a valid date format. In the database (SQL Server), the field is set up as datetime, so I wouldn't think there'd be a problem. I'm just missing something small, I think, but I'm not sure what it is.
how to convert a date in (tuesday,may 17,2005) to a date in(17/05/2005) format. is it possibleto dowith the helpof formatdatetime() function. if possible how ?
I am trying to extract the time out of a date/time but recieve the type mismatch error. The data is stored in an Oracle database as a Date/Time and I am able to extract it from the DB and display it on the screen OK, but when I try and format it like this:
Dim timeofpurchase timeofpurchase = FormatDateTime(rscustomer("time_of_purchase"), 4)
I get an error. I have had a look at documentation on the web but all of the examples only show how to format the current date and time, not how to format a variable that contains a date.
My question is, how do I force my variable, rscustomer("time_of_purchase"), to be treated as a time?? or how do I declare the variable timeofpurchase to accept a date/time??