Skip to content

Commit b78baed

Browse files
committed
Merge pull request #271 from MabOneSdk/mkheranidev1
PM feedback. Taking input in UTC
2 parents 5b3cb10 + 6336673 commit b78baed

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/RecoveryPointConversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static List<AzureRmRecoveryServicesBackupRecoveryPointBase> GetPSAzureRec
3939
{
4040
RecoveryPoint recPoint = rp.Properties as RecoveryPoint;
4141

42-
DateTime recPointTime = DateTime.ParseExact(recPoint.RecoveryPointTime, @"MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture).ToLocalTime();
42+
DateTime recPointTime = DateTime.ParseExact(recPoint.RecoveryPointTime, @"MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
4343
AzureRmRecoveryServicesIaasVmRecoveryPoint rpBase = new AzureRmRecoveryServicesIaasVmRecoveryPoint()
4444
{
4545
Name = rp.Name,

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,4 +416,7 @@ Please contact Microsoft for further assistant.</value>
416416
<data name="UnsupportedContainerException" xml:space="preserve">
417417
<value>Please provide Container of containerType as Windows and backupManagementType as MARS. Provided Container has containerType {0} and backupManagementType {1} which is invalid.</value>
418418
</data>
419+
<data name="GetRPErrorInputDatesShouldBeInUTC" xml:space="preserve">
420+
<value>Both EndDate and StartDate should be in UTC format</value>
421+
</data>
419422
</root>

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/RecoveryPoint/GetAzureRMRecoveryServicesRecoveryPoint.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ public override void ExecuteCmdlet()
6868
throw new ArgumentException(Resources.RecoveryPointEndDateShouldBeGreater);
6969
}
7070

71+
if(StartDate.Kind != DateTimeKind.Utc || EndDate.Kind != DateTimeKind.Utc)
72+
{
73+
throw new ArgumentException(Resources.GetRPErrorInputDatesShouldBeInUTC);
74+
}
75+
7176
parameter.Add(GetRecoveryPointParams.StartDate, StartDate);
7277
parameter.Add(GetRecoveryPointParams.EndDate, EndDate);
7378
PsBackupProviderManager providerManager = new PsBackupProviderManager(parameter, HydraAdapter);

0 commit comments

Comments
 (0)