I've hit a snag with an application I wrote because of the differing
date formats in different countries.
It's a set of pages that make calls to a COM object that I have wrapped
in a web service. The COM object isn't mine, and it wants to receive
dates in a short date format, and it seems to inherit the localized
settings of it's host machine. The machine with that service/COM object
is in Canada and is set to use dd/mm/yyyy date format, and the server
with the pages is in the US and is using mm/dd/yyyy.
When I make calls to the web service, I'm converting the date sent in
using Date.ToShortDat e (which I realize now was a bad decision). I
figured I could get around this by changing the pages server to use
dd/mm/yyyy via the Control Panel, but it seems to have no effect on the
short date being passed to the web service.
Does asp.net have a setting elsewhere that sets this? Any other ideas
(that don't require a code change)? Thanks!
Matt 3 1969
ToShortDateStri ng uses the current thread's CultureInfo object. That class
defines the structure of dates, times, numbers, currency and a few things
about text. Every thread has one.
Since this issue also affects validators, take a look at the section
"Validators support for globalization" in my article at http://aspalliance.com/699. It will give you specifics.
--- Peter Blum www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at http://www.peterblum.com/vam/home.aspx
"MattB" <so********@yah oo.com> wrote in message
news:3m******** *****@individua l.net... I've hit a snag with an application I wrote because of the differing date formats in different countries.
It's a set of pages that make calls to a COM object that I have wrapped in a web service. The COM object isn't mine, and it wants to receive dates in a short date format, and it seems to inherit the localized settings of it's host machine. The machine with that service/COM object is in Canada and is set to use dd/mm/yyyy date format, and the server with the pages is in the US and is using mm/dd/yyyy.
When I make calls to the web service, I'm converting the date sent in using Date.ToShortDat e (which I realize now was a bad decision). I figured I could get around this by changing the pages server to use dd/mm/yyyy via the Control Panel, but it seems to have no effect on the short date being passed to the web service.
Does asp.net have a setting elsewhere that sets this? Any other ideas (that don't require a code change)? Thanks!
Matt
Thanks! I think that set us straight (or at least in the right direction).
Matt
Peter Blum wrote: ToShortDateStri ng uses the current thread's CultureInfo object. That class defines the structure of dates, times, numbers, currency and a few things about text. Every thread has one.
Since this issue also affects validators, take a look at the section "Validators support for globalization" in my article at http://aspalliance.com/699. It will give you specifics.
--- Peter Blum www.PeterBlum.com Email: PL****@PeterBlu m.com Creator of "Profession al Validation And More" at http://www.peterblum.com/vam/home.aspx
"MattB" <so********@yah oo.com> wrote in message news:3m******** *****@individua l.net...
I've hit a snag with an application I wrote because of the differing date formats in different countries.
It's a set of pages that make calls to a COM object that I have wrapped in a web service. The COM object isn't mine, and it wants to receive dates in a short date format, and it seems to inherit the localized settings of it's host machine. The machine with that service/COM object is in Canada and is set to use dd/mm/yyyy date format, and the server with the pages is in the US and is using mm/dd/yyyy.
When I make calls to the web service, I'm converting the date sent in using Date.ToShortDat e (which I realize now was a bad decision). I figured I could get around this by changing the pages server to use dd/mm/yyyy via the Control Panel, but it seems to have no effect on the short date being passed to the web service.
Does asp.net have a setting elsewhere that sets this? Any other ideas (that don't require a code change)? Thanks!
Matt This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: kgatchell2001 |
last post by:
Hi, I am a beginner working on a database to manage clients, payroll,
station assignments, etc. I have created a query which calculates age
based on subtracting the date of birth from the current date. This
works fine and date of birth is entered as month, day, year in
standard short date format (99/99/0000;;).
Here is the problem, I would also like to print out a list of all
clients who have a birthday in any given month. Presently,...
|
by: Dixie |
last post by:
I have a problem using Dev Ashish's excellent module to concatenate the
results of a field from several records into one record.
I am using the code to concatenate certain awards onto a certificate at the
end of the year. I have the code working fine, except for the fact that
when I want to restrict the entries to awards between certain dates, even
though I can use the restriction in the query that shows the actual records,
when the...
|
by: Edward Mitchell |
last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a
format of Time. The controls are all embedded in dialogs. I created the
controls by dragging the DateTime picker from the Toolbox and then set the
Format property appropriately.
I have noticed that sometimes the Time format will reset spontaneously to
Short Date. I looked at the .rc file and found that the usual form for a
Short Date is as follows:
CONTROL ...
|
by: Phil |
last post by:
My regional setting (on Win2000) is:
(General Tab)Locale = English (US)
(Date Tab), short date = MM/dd/yy
When I ask .Net DateFormat.ShortDatePattern,
I get MM/dd/yyyy
Now, where does the yyyy part come from? It looks as if
DateFormat does not look in the overriden format on the
Date tab and just assumes that English(US) is fixed to MM/dd/yyyy...
|
by: CyberLotus |
last post by:
Hi,
I wish to validate the date a user has entered against the format
dd-mmm-yyyy
using the CompareValidator, but it does not work.
Does anybody have a simple solution please?
Many thanks in advance.
| |
by: ABC |
last post by:
Is there any function return the short date format on the regional and
Language Options under control panel?
|
by: savigliano |
last post by:
hello, i am doing a date comparation and i have reallize that the data
i have in my database (general date format) it is causing me problems,
and because i don´t need the time data i would like to convert all the
general date data into short date format, so i would like to delete the
time part of the data, it is any way i can do that ????
Thank you in advance and sorry for my english
carlos
|
by: Matt Brown - identify |
last post by:
Hello,
I'm trying to figure out a method to look up by a range of dates,
entries in a database. The format of the date in the database is "M\D
\yyyy HH:MM:SS".
What i need to do is take the dates that are in the database
(formatted as above), isolate the date (which is in short format) and
compare it to the short formatted date in a datetimepicker.
|
by: OuTCasT |
last post by:
Hi.
I would like to know how to convert the short date format to the long date format for my application without changing the regional settings from short date to long date. ?
|
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,...
|
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...
| |
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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...
|
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: 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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |