-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close GH-11 Introduce Now and UtcNow props
- Loading branch information
1 parent
bed8703
commit 87be3b4
Showing
1 changed file
with
13 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// Author: | ||
// Roman M. Yagodin <[email protected]> | ||
// | ||
// Copyright (c) 2015-2017 Roman M. Yagodin | ||
// Copyright (c) 2015-2018 Roman M. Yagodin | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
|
@@ -19,6 +19,8 @@ | |
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.Web; | ||
using System.Web.UI; | ||
using DotNetNuke.Services.Localization; | ||
using DotNetNuke.UI.Modules; | ||
|
@@ -43,6 +45,16 @@ public class ViewModelContext | |
/// <value>The module instance context.</value> | ||
public ModuleInstanceContext Module { get; protected set; } | ||
|
||
/// <summary> | ||
/// Gets the initial timestamp of the current HTTP request. | ||
/// </summary> | ||
public DateTime Now => HttpContext.Current.Timestamp; | ||
|
||
/// <summary> | ||
/// Gets the initial timestamp of the current HTTP request in UTC. | ||
/// </summary> | ||
public DateTime UtcNow => HttpContext.Current.Timestamp.ToUniversalTime (); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="T:R7.Dnn.Extensions.ViewModels.ViewModelContext"/> class. | ||
/// </summary> | ||
|