# Get-Date Question

**URL:** <https://forums.powershell.org/t/get-date-question/6411>\
**Category:** PowerShell Help\
**Created:** [May 9, 2016, 5:51pm UTC](https://forums.powershell.org/t/get-date-question/6411 "2016-05-09T17:51:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![suresh-krishnan](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@suresh-krishnan](https://forums.powershell.org/u/suresh-krishnan)\
**Post date:** [May 9, 2016, 5:51pm UTC](https://forums.powershell.org/t/get-date-question/6411/1 "2016-05-09T17:51:11Z")

</div>

Dear Community

I need your advise . If i run get-date i get the below format.

Tuesday, 10 May 2016 3:16:22 PM

Now i want the same format to be in produced in my monitoring report  
.But the format is changing .

Below is the line from my script.

“Report Generated $(get-date)”  
Report Generated 05/10/2016 15:16:48

---

<div class="post-metadata">

**Author:** ![alex-innes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/alex-innes/32/129_2.png) [@alex-innes](https://forums.powershell.org/u/alex-innes)\
**Post date:** [May 9, 2016, 8:04pm UTC](https://forums.powershell.org/t/get-date-question/6411/2 "2016-05-09T20:04:13Z")

</div>

Get-date in quotes changes this. try doing

```
$date = get-date -format F

"Report Generated $date"
```

---

<div class="post-metadata">

**Author:** ![csandfeld](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@csandfeld](https://forums.powershell.org/u/csandfeld)\
**Post date:** [May 9, 2016, 8:07pm UTC](https://forums.powershell.org/t/get-date-question/6411/3 "2016-05-09T20:07:17Z")

</div>

Use the -Format parameter of Get-Date to specify the format you want:  
[https://technet.microsoft.com/en-us/library/ee692801.aspx](https://technet.microsoft.com/en-us/library/ee692801.aspx)

In your case use F to get the full date format:

```
"Report Generated $(Get-Date -Format F)"
```

---

<div class="post-metadata">

**Author:** ![csandfeld](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@csandfeld](https://forums.powershell.org/u/csandfeld)\
**Post date:** [May 9, 2016, 8:08pm UTC](https://forums.powershell.org/t/get-date-question/6411/4 "2016-05-09T20:08:03Z")

</div>

Ah … Alex beat me to it 🙂

---

<div class="post-metadata">

**Author:** ![suresh-krishnan](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@suresh-krishnan](https://forums.powershell.org/u/suresh-krishnan)\
**Post date:** [May 9, 2016, 9:04pm UTC](https://forums.powershell.org/t/get-date-question/6411/5 "2016-05-09T21:04:21Z")

</div>

Works like a charm . You guys are awsome. Thank you Alex and Chris 🙂 Appreciate your help and time. .

---

<div class="post-metadata">

**Author:** ![csandfeld](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@csandfeld](https://forums.powershell.org/u/csandfeld)\
**Post date:** [May 9, 2016, 9:22pm UTC](https://forums.powershell.org/t/get-date-question/6411/6 "2016-05-09T21:22:12Z")

</div>

Happy to help Suresh 🙂

---

<div class="post-metadata">

**Author:** ![alex-innes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/alex-innes/32/129_2.png) [@alex-innes](https://forums.powershell.org/u/alex-innes)\
**Post date:** [May 9, 2016, 9:38pm UTC](https://forums.powershell.org/t/get-date-question/6411/7 "2016-05-09T21:38:24Z")

</div>

No problem, any time 🙂

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:41pm UTC](https://forums.powershell.org/t/get-date-question/6411/8 "2024-05-16T20:41:27Z")

</div>

Closed on May 16, 2024, 8:41pm UTC


