Julian Date Code

'***************************************************************** '* Function Name : sJulianDate * '* Created By : Thomas A. Cassano * '* date : 00/00/97 * '* Purpose : * '* Arguments : * '* Returns : string * '* Comments : None * '***************************************************************** public Function sJulianDate(byval dCompare_date as date, _ sEditMask as string) as string on error GoTo sJulianDateErr Dim sErr_Msg as string '*** set pointer Select Case UCase(sEditMask) Case "CCYYDDD" sJulianDate = Format$(dCompare_date, "yyyy") & _ sStrZero(Format$(dCompare_date, "y"), 3) Case "YYDDD" sJulianDate = Format$(dCompare_date, "yy") & _ sStrZero(Format$(dCompare_date, "y"), 3) Case else sJulianDate = sStrZero(Format$(dCompare_date, "y"), 3) End Select Exit Function sJulianDateErr: '*** trapped the error, handle it... sJulianDate = null '*** error reset pointer Screen.MousePointer = vbDefault 'absolute failure sErr_Msg = sErr_Msg & "error in function sJulianDate..." & _ vbCrLf sErr_Msg = sErr_Msg & "error # [" & LTrim(Str(Err.Number)) & _ "] " & Err.Description & vbCrLf sErr_Msg = sErr_Msg & gsSTD_ERR_MSG MsgBox sErr_Msg, vbExclamation & vbOKOnly, gsSTD_WIN_TITLE End Function


Comments

  • Julian Date (my way)

    Posted by Legacy on 07/25/2002 12:00am

    Originally posted by: Steven Fink

    This seems to work ok for me:
    
    


    Public Function JulDate () as String
    dim dt0 as Date
    dim dt1 as Date

    dt0 = Now
    dt1 = DateSerial(CInt(Format(Now(), "YYYY")), 1, 1)
    JulDate = Format((Int(dt0 - dt1) + 1), "000")

    End Function

    Reply
  • Julian Date

    Posted by Legacy on 11/25/2000 12:00am

    Originally posted by: Doug

    I'm sorry, but whatever this is it is NOT a julian date.

    Reply
  • Julian Date Code

    Posted by Legacy on 03/01/2000 12:00am

    Originally posted by: Morris Rothfeldt

    What is the sStrZero Function?

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Live Event Date: August 14, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Data protection has long been considered "overhead" by many organizations in the past, many chalking it up to an insurance policy or an extended warranty you may never use. The realities of today makes data protection a must-have, as we live in a data-driven society -- the digital assets we create, share, and collaborate with others on must be managed and protected for many purposes. Check out this upcoming eSeminar and join Seagate Cloud …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds