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

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

  • Specialization and efficiency are always in need. Whether it's replacing an aging roof, getting a haircut, or tuning up a car, most seek the assistance of trusted experts. The same is true in the business world, where an increasing number of companies are seeking the help of others to administer their IT systems and services. This special edition of Unleashing IT highlights a new breed of IT caretaker -- Cisco Powered service providers -- and the business advantages and operational efficiencies they …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds