Microsoft Virtualization Discussions

Get-NaSnapshot ouput

CharlesYeung
2,780 Views

Hi,

     Is there any way to change Get-Snapshot "Created" field to use local time/timezone instead of GMT time/timezone?

PS C:\Windows\system32> Get-NaSnapshot FFDxxxxxxxxx_SQL_DB | ft -AutoSize

Name                                                                    Created     Total           Cumulative   Dependency
----                                                                         -------         -----             ----------         ----------
sqlsnap__ffdxxxxxxxxx_02-23-2012_19.00.26__daily 2/24/2012 675.5 MB    61.1 GB
sqlsnap__ffdxxxxxxxxx_02-24-2012_19.45.21__daily 2/25/2012 293.9 MB    60.5 GB
sqlsnap__ffdxxxxxxxxx_02-25-2012_19.00.12__daily 2/26/2012  54.4 GB    60.2 GB
sqlsnap__ffdxxxxxxxxx_02-27-2012_19.00.10__daily 2/28/2012   3.1 GB     5.8 GB
sqlsnap__ffdxxxxxxxxx_02-28-2012_19.00.28__daily 2/29/2012   2.7 GB     2.7 GB
sqlsnap__ffdxxxxxxxxx_02-29-2012_19.00.12__daily  3/1/2012   3.6 MB     3.6 MB          

1 ACCEPTED SOLUTION

CharlesYeung
2,780 Views

Hi,

       Thanks .. I find the answer

Get-NaSnapshot FFDxxxxxxxxx_SQL_DB | select name, @{Name="AccessTime"; Expression={[timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddSeconds($_.AccessTime))}}

Name                                                            AccessTime

----                                                            ----------

sqlsnap__ffdxxxxxxxxx_02-23-2012_19.00.26__daily                2/23/2012 7:02:21 PM

sqlsnap__ffdxxxxxxxxx_02-24-2012_19.45.21__daily                2/24/2012 7:46:49 PM

sqlsnap__ffdxxxxxxxxx_02-25-2012_19.00.12__daily                2/25/2012 7:01:51 PM

sqlsnap__ffdxxxxxxxxx_02-27-2012_19.00.10__daily                2/27/2012 7:01:34 PM

sqlsnap__ffdxxxxxxxxx_02-28-2012_19.00.28__daily                2/28/2012 7:02:33 PM

sqlsnap__ffdxxxxxxxxx_02-29-2012_19.00.12__daily                2/29/2012 7:02:07 PM

View solution in original post

1 REPLY 1

CharlesYeung
2,781 Views

Hi,

       Thanks .. I find the answer

Get-NaSnapshot FFDxxxxxxxxx_SQL_DB | select name, @{Name="AccessTime"; Expression={[timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddSeconds($_.AccessTime))}}

Name                                                            AccessTime

----                                                            ----------

sqlsnap__ffdxxxxxxxxx_02-23-2012_19.00.26__daily                2/23/2012 7:02:21 PM

sqlsnap__ffdxxxxxxxxx_02-24-2012_19.45.21__daily                2/24/2012 7:46:49 PM

sqlsnap__ffdxxxxxxxxx_02-25-2012_19.00.12__daily                2/25/2012 7:01:51 PM

sqlsnap__ffdxxxxxxxxx_02-27-2012_19.00.10__daily                2/27/2012 7:01:34 PM

sqlsnap__ffdxxxxxxxxx_02-28-2012_19.00.28__daily                2/28/2012 7:02:33 PM

sqlsnap__ffdxxxxxxxxx_02-29-2012_19.00.12__daily                2/29/2012 7:02:07 PM

Public