Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tUtils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Twin
Twinzo
tUtils
Merge requests
!7
Add FromUnixTimestamp function
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add FromUnixTimestamp function
us-#2-from-unix-timestamp
into
master
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Michal Ondrejička
requested to merge
us-#2-from-unix-timestamp
into
master
2 years ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Ref #2
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
ae2c9ff8
1 commit,
2 years ago
1 file
+
11
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
tUtils/Utils.cs
+
11
−
0
Options
@@ -18,6 +18,17 @@ namespace tUtils
return
(
long
)
span
.
TotalMilliseconds
;
}
/// <summary>
/// Convert unix timestamp in millis to datetime.
/// </summary>
/// <param name="timestamp"></param>
/// <returns>Datetime</returns>
public
static
DateTime
FromUnixTimestamp
(
this
long
timestamp
)
{
DateTime
dtDateTime
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
0
,
DateTimeKind
.
Utc
);
dtDateTime
=
dtDateTime
.
AddMilliseconds
(
timestamp
);
return
dtDateTime
;
}
/// <summary>
///
/// </summary>
Loading