Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VB Script 5.5 (VBS 5.5)

    Hello,
    I need a function that will return a Julian date WITH leading zeros. Does anyone have any suggestions?

    Thanks,
    Mark

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: VB Script 5.5 (VBS 5.5)

    What do you want to use as input to the function?

  4. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: VB Script 5.5 (VBS 5.5)

    Additional question: which Julian Date do you want to use? The 'official' definition is the number of days since January 1, 4713 BC at noon. But some people use the term for the day of the year (e.g. February 10 = the 41st day of the year)

  5. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: VB Script 5.5 (VBS 5.5)

    Numeric values generally do not have leading zeros. One way to construct a string which contains a numeric value padded with leading zeros is along the following lines:

    <code>strPadded = Right("0000" & Cstr(lngNumber), 4) ' returns 0000 to 9999 as a string</code>

Posting Permissions

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