We have our oracle database and web server in the EST timezone. My web application I either need to show GMT to the user or conver the EST datetime to their local datetime, which is my ultimate goal.
Any idea how to do either or?
Thanks
ASP.NETC#
Last Comment
sbornstein2
8/22/2022 - Mon
vora_bhaumik
Public Shared Function ConvertoDate(ByVal dateString As String, ByRef result As DateTime) As Boolean
Try
Dim supportedFormats() As String = New String() {"MM/dd/yyyy", "MM/dd/yy", "ddMMMyyyy", "dMMMyyyy"}
result = DateTime.ParseExact(dateString, supportedFormats, System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None)
Return True
Catch ex As Exception
Return False
End Try
End Function
One of the posts is using the DateTime.Now which I can't do as I already have it stored as EST and the other posts are using assuming it is central time to UTC.
Try
Dim supportedFormats() As String = New String() {"MM/dd/yyyy", "MM/dd/yy", "ddMMMyyyy", "dMMMyyyy"}
result = DateTime.ParseExact(dateSt
Return True
Catch ex As Exception
Return False
End Try
End Function