File size: 1,750 Bytes
9ed2c7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: System.DateTime
date: 2019-10-01T00:00:00.000Z
lastmod: 2019-09-30T23:59:59.000Z
description: There are enough x++ date and time functions to do just about anything, but
sometimes they can make simple tasks fussy, and lack precision.  I was
investigating how to bring in [at least] milliseconds into my my timestamps, and
ran across the DateTime struct
[https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=netframework-4.8] 
and its methods
[https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/system-datetime-methods]
.

Not only does it make a lot of date comp
tags: x++, AX, D365
author: Michael Stashwick
author_url: https://www.d365stuff.co/author/michael/
publisher: D365 Stuff
publisher_url: https://www.d365stuff.co/
---

30 September 2019 / [x++](/tag/x/)

# System.DateTime

There are enough x++ date and time functions to do just about anything, but
sometimes they can make simple tasks fussy, and lack precision. I was
investigating how to bring in [at least] milliseconds into my my timestamps,
and ran across the DateTime [struct](https://docs.microsoft.com/en-
us/dotnet/api/system.datetime?view=netframework-4.8&ref=d365stuff.co) and its
[methods](https://docs.microsoft.com/en-
us/dotnet/framework/data/adonet/sql/linq/system-datetime-
methods?ref=d365stuff.co).

Not only does it make a lot of date components easily accessible, but it has
the day of year, millisecond, and tick measures of time. It's the little
things.

![](https://www.d365stuff.co/content/images/2019/09/image.png)

![Michael Stashwick](/content/images/size/w100/2019/07/FacePic.jpg)

#### [Michael Stashwick](/author/michael/)

Read [more posts](/author/michael/) by this author.

[Read More](/author/michael/)