Formatage date

  • Thread starter Daniel Corréia
  • Start date
D

Daniel Corréia

Bonjour,


Comment connaître en vbscript le formatage de la date (JJ/MM/AAAA, ou
MM/JJ/AAAA....) sur la machine hébergeant les pages asp ?


Merci d'avance
 
D

Daniel Corréia

Sorry I try to translate :

How can I get the date format of the server with a vb script in an ASP page
?
(MM/DD/AAAA for US date or DD/MM/AAAA for european date)

TIA


Daniel CORREIA
 
R

Rob Greene

Greetings Daniel:

You can look at the session variable
Session.LCID
It represents your current localization option. You can also change you output LCID with Response.LCID = 9999

Of course, the next question is where is the list of codes. Here is a link to a table of countries and their LCIDs
http://support.microsoft.com/default.aspx?scid=kb;en-us;221435


Form an old MSDN page I fould somewhere

<%@ LCID=1049 %>

<%
' This file doesn't need to be saved in UTF-8 format because
' there are no literal strings that need formatting or encoding.

Response.Codepage = 65001
Response.Charset = "utf-8"

' The LCID is already 1049
Response.Write "<B>Russia</B><BR>"
Response.Write FormatDateTime("17/01/2001", 1) & "<BR>"
Response.Write FormatDateTime("17:41:35", 3) & "<BR>"
Response.Write FormatCurrency(1000) & "<BR>"
Response.Write FormatNumber(50, 3, 0, 0, -1) & " & " & FormatNumber(.02, 3, 0, 0, -1) & "<BR><BR>"

' Now change the LCID to Korea
Response.LCID = 1042
Response.Write "<B>Korea</B><BR>"
Response.Write FormatDateTime(Date, 1) & "<BR>"
Response.Write FormatDateTime(Time, 3) & "<BR>"
Response.Write FormatCurrency(1000) & "<BR>"
Response.Write FormatNumber(50, 3, 0, 0, -1) & " & " & FormatNumber(.02, 3, 0, 0, -1) & "<BR><BR>"
%>




Locale Locale directory (COUNTRY) Locale identifier (LCID) Default code page Language: Country/region (sub-language)
ARA ARA 0x0401 1256 Arabic: Saudi Arabia
ARI ARI 0x0801 1256 Arabic: Iraq
ARE ARE 0x0c01 1256 Arabic: Egypt
ARL ARL 0x1001 1256 Arabic: Libya
ARG ARG 0x1401 1256 Arabic: Algeria
ARM ARM 0x1801 1256 Arabic: Morocco
ART ART 0x1c01 1256 Arabic: Tunisia
ARO ARO 0x2001 1256 Arabic: Oman
ARY ARY 0x2401 1256 Arabic: Yemen
ARS ARS 0x2801 1256 Arabic: Syria
ARJ ARJ 0x2c01 1256 Arabic: Jordan
ARB ARB 0x3001 1256 Arabic: Lebanon
ARK ARK 0x3401 1256 Arabic: Kuwait
ARU ARU 0x3801 1256 Arabic: U.A.E.
ARH ARH 0x3c01 1256 Arabic: Bahrain
ARQ ARQ 0x4001 1256 Arabic: Qatar
BGR BGR 0x0402 1251 Bulgarian: Bulgaria
CAT CAT 0x0403 1252 Catalan: Spain
CHT CHT 0x0404 950 Chinese: Traditional (Taiwan)
CHS CHS 0x0804 936 Chinese: Simplified (PRC)
ZHH ZHH 0x0c04 936 Chinese: Hong Kong S.A.R., PRC
ZHI ZHI 0x1004 936 Chinese: Singapore
ZHM ZHM 0x1404 936 Chinese: Macau SAR
CSY CSY 0x0405 1250 Czech: Czech Republic
DAN DAN 0x0406 1252 Danish: Denmark
&*GERMANY GER 0x0407 1252 German: Germany – Country name and directory non-standard
DES DES 0x0807 1252 German: Switzerland
DEA DEA 0x0c07 1252 German: Austria
DEL DEL 0x1007 1252 German: Luxembourg
DEC DEC 0x1407 1252 German: Liechtenstein
ELL ELL 0x0408 1253 Greek: Greece
&USA USA 0x0409 1252 English: United States
ENG ENG 0x0809 1252 English: United Kingdom
ENA ENA 0x0c09 1252 English: Australia
ENC ENC 0x1009 1252 English: Canada
ENZ ENZ 0x1409 1252 English: New Zealand
ENI ENI 0x1809 1252 English: Ireland
ENS ENS 0x1c09 1252 English: South Africa
ENJ ENJ 0x2009 1252 English: Jamaica
ENB ENB 0x2409 1252 English: Caribbean
ENL ENL 0x2809 1252 English: Belize
ENT ENT 0x2c09 1252 English: Trinidad
ENW ENW 0x3009 1252 English: Zimbabwe
ENP ENP 0x3409 1252 English: Philippines
&*SPAIN ESP 0x040a 1252 Spanish: Spain (Traditional Sort)
ESM ESM 0x080a 1252 Spanish: Mexico
ESN ESN 0x0c0a 1252 Spanish: Spain (International Sort)
ESG ESG 0x100a 1252 Spanish: Guatemala
ESC ESC 0x140a 1252 Spanish: Costa Rica
ESA ESA 0x180a 1252 Spanish: Panama
ESD ESD 0x1c0a 1252 Spanish: Dominican Republic
ESV ESV 0x200a 1252 Spanish: Venezuela
ESO ESO 0x240a 1252 Spanish: Colombia
ESR ESR 0x280a 1252 Spanish: Peru
ESS ESS 0x2c0a 1252 Spanish: Argentina
ESF ESF 0x300a 1252 Spanish: Ecuador
ESL ESL 0x340a 1252 Spanish: Chile
ESY ESY 0x380a 1252 Spanish: Uruguay
ESZ ESZ 0x3c0a 1252 Spanish: Paraguay
ESB ESB 0x400a 1252 Spanish: Bolivia
ESE ESE 0x440a 1252 Spanish: El Salvador
ESH ESH 0x480a 1252 Spanish: Honduras
ESI ESI 0x4c0a 1252 Spanish: Nicaragua
ESU ESU 0x500a 1252 Spanish: Puerto Rico
FIN FIN 0x040b 1252 Finnish: Finland
&*FRANCE FRA 0x040c 1252 French: France
FRB FRB 0x080c 1252 French: Belgium
FRC FRC 0x0c0c 1252 French: Canada
FRS FRS 0x100c 1252 French: Switzerland
FRL FRL 0x140c 1252 French: Luxembourg
FRM FRM 0x180c 1252 French: Monaco
HEB HEB 0x040d 1255 Hebrew: Israel
HUN HUN 0x040e 1250 Hungarian: Hungary
ISL ISL 0x040f 1252 Icelandic: Iceland
&*ITALY ITA 0x0410 1252 Italian: Italy
ITS ITS 0x0810 1252 Italian: Switzerland
&JAPAN JPN 0x0411 932 Japanese: Japan
&*KOREA KOR 0x0412 949 Korean (Extended Wansung): Korea
&NLD NLD 0x0413 1252 Dutch: Netherlands
NLB NLB 0x0813 1252 Dutch: Belgium
NOR NOR 0x0414 1252 Norwegian: Norway (Bokmål)
NON NON 0x0814 1252 Norwegian: Norway (Nynorsk)
PLK PLK 0x0415 1250 Polish: Poland
&*BRAZIL PTB 0x0416 1252 Portuguese: Brazil
PTG PTG 0x0816 1252 Portuguese: Portugal
ROM ROM 0x0418 1250 Romanian: Romania
RUS RUS 0x0419 1251 Russian: Russia
HRV HRV 0x041a 1250 Croatian: Croatia
SRL SRL 0x081a 1250 Serbian: Serbia (Latin)
SRB SRB 0x0c1a 1251 Serbian: Serbia (Cyrillic)
SKY SKY 0x041b 1250 Slovak: Slovakia
SQI SQI 0x041c 1250 Albanian: Albania
&SVE SVE 0x041d 1252 Swedish: Sweden
SVF SVF 0x081d 1252 Swedish: Finland
THA THA 0x041e 874 Thai: Thailand
TRK TRK 0x041f 1254 Turkish: Turkey
URP URP 0x0420 1256 Urdu: Pakistan
IND IND 0x0421 1252 Indonesian: Indonesia
UKR UKR 0x0422 1251 Ukrainian: Ukraine
BEL BEL 0x0423 1251 Belarusian: Belarus
SLV SLV 0x0424 1250 Slovene: Slovenia
ETI ETI 0x0425 1257 Estonian: Estonia
LVI LVI 0x0426 1257 Latvian: Latvia
LTH LTH 0x0427 1257 Lithuanian: Lithuania
LTC LTC 0x0827 1257 Classic Lithuanian: Lithuania
FAR FAR 0x0429 1256 Farsi: Iran
VIT VIT 0x042a 1258 Vietnamese: Vietnam
HYE HYE 0x042b 1252 Armenian: Armenia
AZE AZE 0x042c 1250 Azeri: Azerbaijan (Latin)
AZE AZE 0x082c 1251 Azeri: Azerbaijan (Cyrillic)
EUQ EUQ 0x042d 1252 Basque: Spain
MKI MKI 0x042f 1251 FYRO Macedonian: Former Yugoslav Republic of Macedonia
AFK AFK 0x0436 1252 Afrikaans: South Africa
KAT KAT 0x0437 1252 Georgian: Georgia
FOS FOS 0x0438 1252 Faeroese: Faeroe Islands
HIN HIN 0x0439 1252 Hindi: India
MSL MSL 0x043e 1252 Malay: Malaysia
MSB MSB 0x083e 1252 Malay: Brunei Darussalam
KAZ KAZ 0x043f 1251 Kazak: Kazakhstan
SWK SWK 0x0441 1252 Swahili: Kenya
UZB UZB 0x0443 1250 Uzbek: Uzbekistan (Latin)
UZB UZB 0x0843 1251 Uzbek: Uzbekistan (Cyrillic)
TAT TAT 0x0444 1251 Tatar: Tatarstan
BEN BEN 0x0445 1252 Bengali: India
PAN PAN 0x0446 1252 Punjabi: India
GUJ GUJ 0x0447 1252 Gujarati: India
ORI ORI 0x0448 1252 Oriya: India
TAM TAM 0x0449 1252 Tamil: India
TEL TEL 0x044a 1252 Telugu: India
KAN KAN 0x044b 1252 Kannada: India
MAL MAL 0x044c 1252 Malayalam: India
ASM ASM 0x044d 1252 Assamese: India
MAR MAR 0x044e 1252 Marathi: India
SAN SAN 0x044f 1252 Sanskrit: India
KOK KOK 0x0457 1252 Konkani: India





-rwg
This is what I think, not necessarily what is accurate!

--------------------
| From: "Daniel Corréia" <[email protected]>
| References: <[email protected]>
| Subject: Re: Formatage date
| Date: Fri, 5 Mar 2004 13:50:34 +0100
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.inetserver.asp.general
| NNTP-Posting-Host: 217.167.39.87
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.inetserver.asp.general:267576
| X-Tomcat-NG: microsoft.public.inetserver.asp.general
|
| Sorry I try to translate :
|
| How can I get the date format of the server with a vb script in an ASP page
| ?
| (MM/DD/AAAA for US date or DD/MM/AAAA for european date)
|
| TIA
|
|
| Daniel CORREIA
|
| "Daniel Corréia" <[email protected]> a écrit dans le message de | (e-mail address removed)...
| > Bonjour,
| >
| >
| > Comment connaître en vbscript le formatage de la date (JJ/MM/AAAA, ou
| > MM/JJ/AAAA....) sur la machine hébergeant les pages asp ?
| >
| >
| > Merci d'avance
| > --
| > Daniel CORREIA
| >
| >
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top