If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Change default short date format

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-20-03, 03:59
arvindn arvindn is offline
Registered User
 
Join Date: Nov 2003
Location: India
Posts: 10
Question Change default short date format

How do i change the default short date format in Windows thru VB code for my db applications?

(Users can interactively change the default short date fromat by going thru Control Panel -> Regional Settings -> Date )
Reply With Quote
  #2 (permalink)  
Old 11-20-03, 05:15
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
Lightbulb Format

Format(field,format)


Format(rsDate,"dd-mm-yyyy HH:NNS")
Reply With Quote
  #3 (permalink)  
Old 11-20-03, 06:36
arvindn arvindn is offline
Registered User
 
Join Date: Nov 2003
Location: India
Posts: 10
Thanks for replying.
As i said in the thread opener, i need to change the default short date format of Windows and so format is simply a function for one time usage which will not work.
Reply With Quote
  #4 (permalink)  
Old 11-20-03, 08:15
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
Thumbs down change user regional settings ????

it's not normaly to change the settings of a user, he/she have set them for some reson.

if you want to show them a date in your format use the format function

or if they have to give you input, trap the input and change it to your format or use a MaskEditBox with your desired format

But if you realy want to change it there must be some kind of API you can call (remember to reset them to his her setting, not every 1 uses the same format: USA: MM-DD-YYYY ; EUROPA : DD-MM-YYYY ; ACCESS : YYYY-MM-DD )

some comment using general settings :
When you enter data using locale-specific format in the Grid pane, the Query Designer automatically translates it to ANSI format in the SQL pane. For example, if your Regional Settings are set to Standard German, you can enter a date in the Grid pane in a format such as "31.12.96." However, the date will appear in the SQL pane in ANSI datetime format as { ts '1996-12-31 00:00:00' } If you enter data directly in the SQL pane, you must enter it in ANSI format.
Reply With Quote
  #5 (permalink)  
Old 11-20-03, 08:56
arvindn arvindn is offline
Registered User
 
Join Date: Nov 2003
Location: India
Posts: 10
Re: change user regional settings ????

Quote:
Originally posted by Marvels
it's not normaly to change the settings of a user, he/she have set them for some reson.

But if you realy want to change it there must be some kind of API you can call (remember to reset them to his her setting, not every 1 uses the same format: USA: MM-DD-YYYY ; EUROPA : DD-MM-YYYY ; ACCESS : YYYY-MM-DD )

Thanks once again.

I can assure u that there's a logical reason for changing the settings of the user.

Can u please tell me the name of the API (i've very rarely used them before and so know little about them) and the syntax.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On