-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
14 changed files
with
179 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member | ||
|
||
using System; | ||
using RethinkDb.Driver.Net.JsonConverters; | ||
|
||
namespace RethinkDb.Driver.Ast | ||
{ | ||
public partial class TopLevel | ||
{ | ||
/// <summary> | ||
/// Type-safe helper method for R.Iso8601 | ||
/// </summary> | ||
public Iso8601 Iso8601(DateTime? datetime) | ||
{ | ||
var str = datetime?.ToString("o"); | ||
return Ast.Iso8601.FromString(str); | ||
} | ||
/// <summary> | ||
/// Type-safe helper method for R.Iso8601 | ||
/// </summary> | ||
public Iso8601 Iso8601(DateTimeOffset? datetime) | ||
{ | ||
var str = datetime?.ToString("o"); | ||
return Ast.Iso8601.FromString(str); | ||
} | ||
|
||
/// <summary> | ||
/// Type-safe helper for R.EpochTime | ||
/// </summary> | ||
public EpochTime EpochTime(DateTime? datetime) | ||
{ | ||
var ticks = datetime?.ToUniversalTime().Ticks; | ||
var epoch = ReqlDateTimeConverter.ToUnixTime(ticks.Value); | ||
return EpochTime(epoch); | ||
} | ||
/// <summary> | ||
/// Type-safe helper for R.EpochTime | ||
/// </summary> | ||
public EpochTime EpochTime(DateTimeOffset? datetime) | ||
{ | ||
var ticks = datetime?.UtcTicks; | ||
var epoch = ReqlDateTimeConverter.ToUnixTime(ticks.Value); | ||
return EpochTime(epoch); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.