Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default ANSI Standard date

    Hi,

    Could somebody please tell me, or point me to an article, that shows me how
    to pick up an ANSI standard date directly from
    asp (VB Script) code.

    The now() function seems to pick up the date with the default settings of
    the server.
    ie if the date format is dd/mm/yyyy it will pick up 09072003
    and if the date format is mm/dd/yyyy it will pick up 07092003

    what I am looking for is a function that will always pick up the date in the
    format

    yyyymmdd

    ie

    20030709

    if there is not a built in VB Script function then can I get this directly
    from the registry.

    Thanks in advance.


    cheers

    Dave.


    Dave Guest

  2. Similar Questions and Discussions

    1. [ANNOUNCE] Win32::Console::ANSI v1.0
      I'm happy to announce the last release of Win32::Console::ANSI. On Win32 systems, this module emulates an ANSI console for the script that uses...
    2. ANSI-colored text in menu possible?
      Hi, is it possible to use text colored by ANSI-escape-sequences in a menu generated by perlmenu.pm or Cmenu.pm? If not, is there a perlmodule...
    3. Win32::Console::ANSI messes up IO
      Hi, I have some Perl scripts that use Term::ANSIColor to output error messages in reverse mode. Works fine on Unix, so I was disappointed to...
    4. Formatting (ANSI) highlighted strings
      Hi folks, Using the 'text/highlight' package on RubyForge, you can emit coloured strings to the console like so: s =...
    5. [PHP-DEV] [PHP-CVS] cvs: php-src / NEWS /ext/standard parsedate.y /ext/standard/tests/time
      Derick Rethans wrote: bison -y /usr/src/php/php5/ext/standard/parsedate.y conflicts: 17 shift/reduce...
  3. #2

    Default Re: ANSI Standard date


    "Dave" <davidb1234@hotmail.com> wrote in message
    news:uYEilQgRDHA.3192@TK2MSFTNGP10.phx.gbl...
    > Could somebody please tell me, or point me to an article, that shows me
    how
    > to pick up an ANSI standard date directly from
    > asp (VB Script) code.

    myDDMMYYYY = day(Date()) & "/" & month(Date()) & "/" & year(Date())

    or

    myYYYYMMDD = year(Date()) & month(Date()) & day(Date())



    Paul White Guest

  4. #3

    Default Re: ANSI Standard date

    Paul White wrote:
    > "Dave" <davidb1234@hotmail.com> wrote in message
    > news:uYEilQgRDHA.3192@TK2MSFTNGP10.phx.gbl...
    >> Could somebody please tell me, or point me to an article, that shows
    >> me how to pick up an ANSI standard date directly from
    >> asp (VB Script) code.
    >
    >
    > myDDMMYYYY = day(Date()) & "/" & month(Date()) & "/" & year(Date())
    >
    > or
    >
    > myYYYYMMDD = year(Date()) & month(Date()) & day(Date())
    This won't work: check out what you get for 1/1/2003. You need something
    like this:

    myYYYYMMDD = year(Date()) & Right("0" & month(Date()),2) & _
    Right("0" & day(Date()),2)

    HTH,
    Bob Barrows


    Bob Barrows Guest

  5. #4

    Default Re: ANSI Standard date

    Quote Originally Posted by Dave View Post
    Hi,

    Could somebody please tell me, or point me to an article, that shows me how
    to pick up an ANSI standard date directly from
    asp (VB Script) code.

    The now() function seems to pick up the date with the default settings of
    the server.
    ie if the date format is dd/mm/yyyy it will pick up 09072003
    and if the date format is mm/dd/yyyy it will pick up 07092003

    what I am looking for is a function that will always pick up the date in the
    format

    yyyymmdd

    ie

    20030709

    if there is not a built in VB Script function then can I get this directly
    from the registry.

    Thanks in advance.


    cheers

    Dave.
    The easy way...
    Format (Now(), "YYYY-MM-DD")
    Unregistered Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139