# 'en-NZ culture' - default date format 'dd/MM/yyyy'

**URL:** https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091
**Category:** PowerShell Help
**Created:** [April 9, 2023, 11:00pm UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091 "2023-04-09T23:00:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dmbuckle](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dmbuckle/32/4462_2.png) [@dmbuckle](https://forums.powershell.org/u/dmbuckle)
#### Post date: [April 9, 2023, 11:00pm UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091/1 "2023-04-09T23:00:26Z")

</div>

When run on PowerShell(7) …

```auto

```

```auto
PS> $datePattern = '\d{4}-\d{2}-\d{2}'
'Today is 1999-12-31' -replace $datePattern, { [datetime]$PSItem.value }

```

```auto
... produces:- 
'Today is 12/31/1999 00:00:00'
rather than (my Locale Pattern):-
'Today is 31/12/1999 00:00:00'

```

when:-

```auto
PS > Get-Culture -Debug
... produces:- 

LCID Name DisplayName
---- ---- -----------
5129 en-NZ English (New Zealand)

```

… Am I wrong?

In the “en-NZ” culture, the default date format is “dd/MM/yyyy”. When converting the date string ‘1999-12-31’ to a datetime object (cast … [datetime]), PowerShell uses the default date format of the current culture to display the datetime object. Therefore, ‘12/31/1999 00:00:00’ should be ‘31/12/1999 00:00:00’.  
Is this not the case? Could this be a PowerShell bug? How do I test this possibility?

I was excited to (finally) discover PowerShell a couple of weeks ago … enjoying, the (for me, very steep) ‘learning curve’ … has to be said … 76 year old, of dubious intellectual stature … 35 year photography career and a retirement plan to unite past clients, with their original (now being digitised by me) pictures, which involves a significant amount of metadata and general data manipulation…

---

<div class="post-metadata">

### Author: ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)
#### Post date: [April 10, 2023, 12:20am UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091/2 "2023-04-10T00:20:19Z")

</div>

Don,  
Welcome to the forum. 👋🏼

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( \</\> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

[How to format code in PowerShell.org](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/b/bee50c628238f2c076c0504efb6b15f2fb11f002.gif) 1 \<---- Click 👆🏽 😉

How do you populate `$PSItem`?

And what is it what you’re actually trying to do? There might be another/a better way. 😉

You can always format a date to your particular needs:

```auto
$DateTime = Get-Date
$DateTime.ToString('dd\/MM\/yyyy HH:mm:ss')

```

---

<div class="post-metadata">

### Author: ![dmbuckle](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dmbuckle/32/4462_2.png) [@dmbuckle](https://forums.powershell.org/u/dmbuckle)
#### Post date: [April 10, 2023, 7:26pm UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091/3 "2023-04-10T19:26:02Z")

</div>

I have made a first forum submission … did not format code … how do I edit this submission to rectify?

---

<div class="post-metadata">

### Author: ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)
#### Post date: [April 10, 2023, 8:53pm UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091/4 "2023-04-10T20:53:03Z")

</div>

> [@dmbuckle](#):
>
> how do I edit this submission to rectify?

![image](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/b/bc42a47f67f828a93c47b56d7b459a1644583e0c.png)

If it’s not there don’t bother. I’ve heard from users that they couldn’t edit their post later on.

How about your issue? Could you solve it in the meantime?

---

<div class="post-metadata">

### Author: ![dmbuckle](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dmbuckle/32/4462_2.png) [@dmbuckle](https://forums.powershell.org/u/dmbuckle)
#### Post date: [April 10, 2023, 8:57pm UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091/5 "2023-04-10T20:57:43Z")

</div>

Thanks Olaf … no response so far but I am still trying to increase my knowledge … plenty yet to learn …

---

<div class="post-metadata">

### Author: ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)
#### Post date: [April 10, 2023, 9:06pm UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091/6 "2023-04-10T21:06:14Z")

</div>

> [@dmbuckle](#):
>
> no response so far

What do you mean? What about my first reply? `¯\_(ツ)_/¯`

---

<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:14pm UTC](https://forums.powershell.org/t/en-nz-culture-default-date-format-dd-mm-yyyy/22091/7 "2024-05-16T20:14:56Z")

</div>


