Table of Contents

Class NASA

Namespace
The.Utility
Assembly
Instagile.dll

Parses "NASA" relative expressions of the form "T", "T+4", "T-2w" into absolute values. Date expressions step by days/weeks/months/years; time expressions step by seconds/minutes/hours.

public static class NASA
Inheritance
NASA
Inherited Members

Fields

DatePattern

public static readonly Regex DatePattern

Field Value

Regex

TimePattern

public static readonly Regex TimePattern

Field Value

Regex

Methods

TryParseDate(string, out DateTime)

Parses a NASA relative-date expression (e.g. "T", "T+4", "T-2w") into an absolute date. Returns false when the input isn't a date expression or its offset falls outside the range of a DateTime.

public static bool TryParseDate(string s, out DateTime result)

Parameters

s string
result DateTime

Returns

bool

TryParseTime(string, out DateTime)

Parses a NASA relative-time expression (e.g. "T", "T+30", "T-2h", "T+45s") into a moment offset from now. Returns false when the input isn't a time expression or its offset falls outside the range of a DateTime.

public static bool TryParseTime(string s, out DateTime result)

Parameters

s string
result DateTime

Returns

bool