473,700 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date in regional format in different regions

I'm updating a db in which I have a column of Date/Time data type. The
regional settings here for short date are:
day / month / full year
eg. 28/4/2005

It's easy enough for me to build a string with the appropriate date but
how do I handle different regional settings for short date, such as:
month / day / full year
Andrew Poulos
Jul 23 '05 #1
3 2805
Andrew Poulos wrote on 02 mei 2005 in comp.lang.javas cript:
I'm updating a db in which I have a column of Date/Time data type. The
regional settings here for short date are:
day / month / full year
eg. 28/4/2005

It's easy enough for me to build a string with the appropriate date but
how do I handle different regional settings for short date, such as:
month / day / full year


You don't have to handle those, as the client settings will do it for you.

Perhaps however your idea of "handling" differs from mine.

Please be more explicit about that.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #2
Andrew Poulos wrote on 02 mei 2005 in comp.lang.javas cript:
Evertjan. wrote:
Andrew Poulos wrote on 02 mei 2005 in comp.lang.javas cript:
The db with the current regional settings expects the date in this
format dd/mm/yyyy. The best I can do with js is this:
theDate.getD ate() +"/"+ (theDate.getMon th()+1) +"/"+ theDate.getFull Year

You don't specify the db engine you use,
but common advice is to use yyyy/mm/dd
in SQL string litterals of the type date.

Ah, I get it (finally) I need to specifically nominate the date format
instead of simply choosing a preset.


I think you don't.

If you format the date to be used in an sql string as yyyy/mm/dd it will
always be understood correctly by most database engines.

If you want more help please answer the quetions in my last posting:

1 I suppose we are now talking serverside ASP jscript?
2 What database engine are you using?



--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #3
JRS: In article <4275ec23$0$128 09$5a62ac22@per-qv1-newsreader-
01.iinet.net.au >, dated Mon, 2 May 2005 19:00:18, seen in
news:comp.lang. javascript, Andrew Poulos <ap*****@hotmai l.com> posted :
I'm updating a db in which I have a column of Date/Time data type. The
regional settings here for short date are:
day / month / full year
eg. 28/4/2005

It's easy enough for me to build a string with the appropriate date but
how do I handle different regional settings for short date, such as:
month / day / full year


In addition to what has been said : if you can arrange to read a known
date from the database, a date with Y M and D all different, then a
little logic will determine what format it outputs. The database can
probably read that format.

But use YYYY-MM-DD if you can, and as a second choice YYYY/MM/DD - wach
with fields padded to 4 2 2 with leading zeroes.


For those interested, with non-MSIE browsers : the core of the new part
of <URL:http://www.merlyn.demo n.co.uk/js-boxes.htm> could do with a re-
check.

Depict, which used a form and a table around a textarea, is replaced by
a simpler Depikt, which uses CSS for the area surround.

The appearance on my system is perceptibly different, but still matches
the written description.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #4

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

Similar topics

1
4843
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime before Windows 2000 Service Pack 4 and has remained through to Windows XP. I am looking for a solution that doesn't involve rewriting our application (much) and that allows all our users to keep using Hebrew Regional Settings. To summarize our...
1
2277
by: Karl Irvin | last post by:
My regional setting is English(United States) My customers setting is French(Canada) When he runs my program using a typed in date, he gets a "date invalid" error. Do I need to do something to dates in Access when the regional settings are different? The error may not be coming from Access but from a purchased module that
2
5084
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings set to "en-UK" and date to
9
3223
by: Bob Achgill | last post by:
I would like to use the timestamp on files to manage the currency of support files for my VB windows application. In this case I would only put the timestamp of the file in the management database and not the file itself. To do this I will need to have a File class property for Create time and date that will let me "set" the Create time and date of the file to my own chooseing. The VB file class does not appear to have the ability
5
5329
by: Ellis Yu | last post by:
Dear All I want to read the short date format pattern from the regional setting. I write a code as follow: 'Diff. machine may has different country setting, so I use blank here Dim a as new CultureInfo("") Dim shortDatePattern as String
9
6368
by: insomniux | last post by:
Hi, I am having a problem with formatting the default value of a date field. It has been discussed earlier in many topics, but still I cannot solve the problem. What's happening: I have various forms which are based on an ODBC-linked tables. In one of the forms, I have a control which shows the date of a date field in my database (storage type=date). The default value for the control is set to '=Date()', the format property is set to...
16
11901
by: Mik | last post by:
I apologise if this post seems a little basic, but I am a newbie and have NO access knowledge. I have downloaded the Accounts Ledger from the Microsoft Website. It allows the user to review a report of transactions between a Start & End date. The Tables and forms i believe are UK format "dd/mm/yyyy", However, when I click on "Review Reports" and enter the date as UK "dd/mm/yyyy", it returns nothing.
10
5811
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a date format in the table design, such as: mm/dd/yyyy? What I've done for years is to store the date format in date fields, then on the forms, based on their region, I would set the date formats on form_load
30
5701
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the database I have a table with Date/time column. The database is located on a machine that is set to dd/mm/yyyy also. When I enter date 7/1/08 (as in January 7, 2008), it stores it in the database as 1/7/08 instead of 7/1/08. Why is it like that...
0
8649
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9219
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9081
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7819
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5904
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4408
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4660
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3097
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 we have to send another system

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.