What date is it?

Results 1 to 5 of 5

Thread: What date is it?

  1. #1
    Conrad Guest

    Default What date is it?

    What is the syntax to get the date to this format<BR>YYYY/MM/DD<BR><BR>Example:<BR>2000/09/01<BR><BR>I would like to format today&#039s date to this format. Maybe using Date() or such.<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default RE: What date is it?

    A sneaky way:<BR><BR>&#060;%<BR>oldLCID = Session.LCID<BR>Session.LCID = 1041 &#039 Japanese...but most European would work<BR>today = CStr( Date ) &#039 should be "2000/09/01"<BR>Session.LDIC = oldLCID &#039 whatever your default is<BR>%&#062;<BR><BR>A not quite so sneaky way:<BR><BR>&#060;%<BR>today = Year(Date) & "/" & Right("0" & Month(Date),2) & "/" & Right("0" & Day(Date),2)<BR>%&#062;<BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    1,364

    Default RE: What date is it?

    Here is how I did it. Just change the variable in the right order.<BR>&#060;%=month(date) & "/" & day(date) & "/" & year(date)%&#062;

  4. #4
    Conrad Guest

    Default I thank you both.

    Very much.


  5. #5
    Join Date
    Dec 1969
    Posts
    96,118

    Default RE: What date is it?

    &nbsp;<BR>Dan wrote:<BR>&#062; Here is how I did it. Just change the variable in the right order.<BR>&#062; &#060;%=month(date) & "/" & day(date) & "/" & year(date)%&#062; <BR><BR>Only problem with that is that you will end up with (for today)<BR>&nbsp;&nbsp;&nbsp;&nbsp;9/1/2000<BR>and the original question was asking for <BR>&nbsp;&nbsp;&nbsp;&nbsp;2000/09/01<BR><BR>Changing the order of your answer is easy, but you need to use a trick like mine with the "Right" function in order to get the leading zeroes on the month and day.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •