473,480 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to set correct date format

Hi
I have set with lcid value. but i am not able to overcome my nt server
regional setting. Actually i want a date in mm/dd/yyyy. But i get date as
mm/dd/yy. How to ensure that i shall always get correct format irrespective
of os or regional setting.

regards
himanshu
Jul 19 '05 #1
3 7225
Himanshu Dora wrote:
Hi
I have set with lcid value. but i am not able to overcome my nt
server regional setting. Actually i want a date in mm/dd/yyyy. But i
get date as mm/dd/yy. How to ensure that i shall always get correct
format irrespective of os or regional setting.


Convert the date to a string with the proper format using the various date
functions available: day(), month(), year(). This way, you are in control,
rather than the Regional Settings.

Bob Barrows
Jul 19 '05 #2
http://www.aspfaq.com/2260
http://www.aspfaq.com/2313

"Himanshu Dora" <hi**********@hotmail.com> wrote in message
news:u#**************@TK2MSFTNGP10.phx.gbl...
Hi
I have set with lcid value. but i am not able to overcome my nt server
regional setting. Actually i want a date in mm/dd/yyyy. But i get date as
mm/dd/yy. How to ensure that i shall always get correct format irrespective of os or regional setting.

regards
himanshu

Jul 19 '05 #3
To make a variable be in the format of mm/dd/yyyy, perhaps try something
like the following which you might even make into a function:

varFld = CDate(MyVariable)

intMonth = Month(varFld)
intDay = Day(varFld)
intYr = Year(varFld)

If intMonth < 10 Then
strMonth = "0" & CStr(intMonth)
Else
strMonth = CStr(intMonth)
End If

If intDay < 10 Then
strDay = "0" & CStr(intDay)
Else
strDay = CStr(intDay)
End If

strYr = Right(CStr(intYr), 4) ' And change the 4 to 2 for 2 year dates.

varFld = CStr(strMonth & "/" & strDay & "/" & strYr)

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

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

Similar topics

0
1005
by: ST | last post by:
Hello, I will be posting 2 errors that I just can't seem to figure out (I'll put them in different posts). I have looked all over the internet, and I still can't figure these out! This webapp was...
4
43513
by: Matteo | last post by:
Hy everybody. I'm not a html writer, but a sysadmin who's trying to help a user able to compile an online form with IE but not with Mozilla (Moz1.6, Ns7.1, Firefox 0.8+) due to a javascript date...
0
1323
by: GMG | last post by:
Background : with XML data islands you can bind data to HTML tags. If you do not provide a DTD it will display the information as is. If you provide a DTD IE will display the data according to its...
6
3298
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
3
11732
by: dan | last post by:
I am using VB.NET 2003 and SQL Server 2000. The program uses ADO.NET . The following instruction: Me.cd_insertDataRecord.ExecuteNonQuery() throws this exception: ">>>ProcessDataRecord/...
7
2220
by: tjonsek | last post by:
I'm building a string to be used as the body of an email. I'm getting this error message. "Input String Not In Correct Format". I've checked several newsgroups, however, for the posts I found...
1
1256
seshu
by: seshu | last post by:
hi everybody this is seshu i have problem in formating the date actualy the data base iam using is mysql which is following yyyy-mm-dd format where as in my front end ie vb.net...
3
3182
by: Luqman | last post by:
I have deployed my ASP.Net Application on Windows Server 2000, Service Pack 4, when I run my Application and shows today's date with system.date.today.ToShortDateString, it shows in the format...
7
1632
by: plumba | last post by:
Hiya all. I have a form which the user selects a date from a javascript style calendar, it puts the date into a field in the format dd/mm/yyyy. I want the form to compare this user selected...
0
6908
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
7048
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5342
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4783
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4485
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2986
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
183
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.