Esempio n. 1
0
        internal static System_DateTime StrToTime(Context ctx, string timestr, System_DateTime time)
        {
            if (string.IsNullOrEmpty(timestr) || timestr.EqualsOrdinalIgnoreCase("now"))
            {
                return(System_DateTime.UtcNow);
            }

            var result = DateTimeFunctions.strtotime(ctx, timestr, DateTimeUtils.UtcToUnixTimeStamp(time));

            return((result >= 0) ? DateTimeUtils.UnixTimeStampToUtc(result) : System_DateTime.UtcNow);
        }
Esempio n. 2
0
    private static System_DateTime StrToTime(string timestr, System_DateTime time)
    {
        if (string.IsNullOrEmpty(timestr) || timestr.Equals("now", StringComparison.OrdinalIgnoreCase))
        {
            return(System_DateTime.UtcNow);
        }

        var result = DateTimeFunctions.strtotime(timestr, DateTimeUtils.UtcToUnixTimeStamp(time));

        return((result >= 0) ? DateTimeUtils.UnixTimeStampToUtc(result) : System_DateTime.UtcNow);
    }