コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: zAfLu/Twice
 private DateTime Date(long n)
 {
     return(EpochStart.Add(TimeSpan.FromSeconds(n)));
 }
コード例 #2
0
 /// <summary>
 /// Called when [epoch start].
 /// </summary>
 /// <param name="epoch">The epoch.</param>
 protected void OnEpochStart(int epoch)
 {
     EpochStart?.Invoke(this, new EpochStartEventArgs(epoch));
 }
コード例 #3
0
 /// <summary>
 /// Convert from a timestamp to a <see cref="DateTime"/>.
 /// </summary>
 /// <param name="timestamp">
 /// The timestamp to convert.
 /// </param>
 /// <returns>
 /// The <see cref="DateTime"/> representing the same date and time.
 /// </returns>
 public static DateTime ToDateTime(double timestamp)
 {
     return(EpochStart.AddSeconds(timestamp));
 }