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

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Email is the most common communication vehicle used by organizations of all shapes and sizes. Among the billions of email messages sent every day are sensitive information, critical requests, and other essential business data. IT staff bear the burden of ensuring the confidentiality, integrity, and availability of the information contained within the communication. This white paper explores the email security landscape, an assessment of the threats organizations face,  and the building blocks of an effective …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds