Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: format as d/m/yy


Message #1 by "Chapman, David" <david.chapman@d...> on Mon, 22 Jul 2002 17:08:13 +0930
would somebody please tell me how to eliminate time info and format a date
as d/m/yy.
I have been trying to use the formatdate function, but do not know the
vbconstant that will do it. I would really appreciate it if somebody could
point me to a full list of vbconstants and explanations.

David Chapman
Corporate Business Solutions (CBS) 
Science Resource Management, DSTO 
Room 17, LAB 73 Edinburgh, SA, 5108 
Phone +xx x xxxx xxxx
Fax +xx x xxxx xxxx 
Email david.chapman@d... 
IMPORTANT: this email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of Section 70 of the Crimes
Act 1914. If you have received this email in error, you are requested to
contact the sender and delete the email.


Message #2 by "Ken Schaefer" <ken@a...> on Mon, 22 Jul 2002 17:53:07 +1000
http://download.microsoft.com/download/winscript56/Install/5.6/W982KMeXP/EN-
US/scrdoc56en.exe
is where you can download the VBScript docs.

There is a formatdatetime() function that accepts a parameter vbShortDate

For additional flexbility, I also have a date/time formatting function:
www.adopenstatic.com/resources/code/formatdate.asp

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chapman, David" <david.chapman@d...>
Subject: [access_asp] format as d/m/yy


: would somebody please tell me how to eliminate time info and format a date
: as d/m/yy.
: I have been trying to use the formatdate function, but do not know the
: vbconstant that will do it. I would really appreciate it if somebody could
: point me to a full list of vbconstants and explanations.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #3 by "Larry Woods" <larrywoods@c...> on Mon, 22 Jul 2002 05:07:37 -0700
David,

You could use the FormatDateTime function.

FormatDateTime ( date,dateFormat )

The output for the legal values of 'dateFormat' are:

Using FormatDateTime(date,dateFormat):

dateFormat Output
0          7/22/2002
1          Monday, July 22, 2002
2          7/22/2002
3          12:00:00 AM
4          00:00

Using FormatDateTime(time,dateFormat):

dateFormat Output
0          5:01:29 AM
1          Saturday, December 30, 1899
2          12/30/1899
3          5:01:29 AM
4          05:01

If you want other formats you can "break up" the date by using
the Year,Month,Day,Minute and Second functions, then display each
value separately.

Hope this helps...

Larry Woods - MCSD, MCT


> -----Original Message-----
> From: Chapman, David [mailto:david.chapman@d...]
> Sent: Monday, July 22, 2002 12:38 AM
> To: Access ASP
> Subject: [access_asp] format as d/m/yy
>
>
> would somebody please tell me how to eliminate time
> info and format a date
> as d/m/yy.
> I have been trying to use the formatdate function, but
> do not know the
> vbconstant that will do it. I would really appreciate
> it if somebody could
> point me to a full list of vbconstants and explanations.
>
> David Chapman
> Corporate Business Solutions (CBS)
> Science Resource Management, DSTO
> Room 17, LAB 73 Edinburgh, SA, 5108
> Phone +xx x xxxx xxxx
> Fax +xx x xxxx xxxx
> Email david.chapman@d...
> IMPORTANT: this email remains the property of the
> Australian Defence
> Organisation and is subject to the jurisdiction of
> Section 70 of the Crimes
> Act 1914. If you have received this email in error,
> you are requested to
> contact the sender and delete the email.
>
>
>
>

Message #4 by "Stephan" <Stephan_bussing@h...> on Tue, 23 Jul 2002 16:00:02
Hi David,

Be aware of the datetimeformat. It depends on the serversettings. If you 
use the datetime format, the standard setting is us dateformat. This can 
be converted to european dateformat by using the setlocale function. See 
de vbscript documentation for this option. An other possibility is to use 
the LCID.

Also read this article
http://www.4guysfromrolla.com/webtech/041001-1.shtml

Greetzzz

Stephan

> would somebody please tell me how to eliminate time info and format a 
date
as d/m/yy.
I have been trying to use the formatdate function, but do not know the
vbconstant that will do it. I would really appreciate it if somebody could
point me to a full list of vbconstants and explanations.

David Chapman
Corporate Business Solutions (CBS) 
Science Resource Management, DSTO 
Room 17, LAB 73 Edinburgh, SA, 5108 
Phone +xx x xxxx xxxx
Fax +xx x xxxx xxxx 
Email david.chapman@d... 
IMPORTANT: this email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of Section 70 of the Crimes
Act 1914. If you have received this email in error, you are requested to
contact the sender and delete the email.



  Return to Index