Skip to content

Julian

Static helpers for validating and converting between Julian-format date strings (year + day-of-year) and DateTime, matching an EDI/legacy Julian date convention.

Purpose

  • Static helpers for validating and converting between Julian-format date strings (year + day-of-year) and DateTime, matching an EDI/legacy Julian date convention.

Context

  • Namespace: SAIF.Common
  • Assembly/package: SAIF.Framework.Common

Public members

Member Signature Purpose
IsValid(int value, out string message) public static bool IsValid(int value, out string message) Validates a numeric Julian date value, returning a diagnostic message via out when invalid. (BR-022)
IsValid(string value, out string message) public static bool IsValid(string value, out string message) Validates a string Julian date value, returning a diagnostic message via out when invalid. (BR-023)
GetYear(string value, out bool isLeapYear, int centuryBase) public static int GetYear(string value, out bool isLeapYear, int centuryBase) Resolves the 4-digit year and leap-year flag encoded in a Julian string, using centuryBase to disambiguate the 2-digit year. (BR-024, BR-025)
ToJulian(this DateTime value, int centuryBase) public static string ToJulian(this DateTime value, int centuryBase) Encodes a DateTime as a Julian-format string (year + day-of-year) relative to centuryBase. (BR-027)
ToDate(string value, int centuryBase) public static DateTime ToDate(string value, int centuryBase) Parses a Julian-format string back into a DateTime, resolving the year via GetYear. (BR-024, BR-025, BR-026)

Sources

  • Common/SAIF.Common/Classes/Julian.cs