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 …

  • As a development and deployment platform, RHEL offers an efficient, scalable, and robust operating environment with certified security and flexible deployment options in physical and virtualized environments. To assess and quantify the business benefits of RHEL, IDC recently conducted in-depth interviews with IT staff members of 21 companies using RHEL servers. The organizations represent a broad range of industries and have an average of 22,700 employees. RHEL servers accounted for 23% of the servers …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds