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 …

  • Businesses are moving more and more of their customer transactions to the web. Security is understandably a top concern as online transactions increase, so it is important to make sure your electronic signature provider meets the highest security standards. That means more than simply passing a security audit or obtaining a certification. This white paper provides recommendations for taking a broader view of e-signature security, and answers key questions that help identify the security requirements against …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds