Cerebrus, your suggestion is good. but scenerio is that the now code can't be modified with my hands. I referred to
http://weblogs.asp.net/jlerman/pages/25420.aspx, while coding which displays output as per my requirement. where, 1. ((DateTime)(datarow.ItemArray[13])).GetDateTimeFormats()[5]) returns 2003-09-01 2. ((DateTime)(datarow.ItemArray[13])).GetDateTimeFormats()[110]) returns 0:00:00 the second case above is not working, it's returning me 00:00:00 AM. Is this behaviour correct. I check the culture at my server as "en- US". any reason for above much appreciated. solution other than using GetDateTimeFormats, will not help me at this moment. Rgds, ND On Jan 11, 6:59 pm, Cerebrus <[email protected]> wrote: > Since GetDateTimeFormats() outputs ALL possible supported formats into > an array, using it in your scenario seems like a terrible way to get > ONE string format ! Or maybe I haven't comprehended your scenario > correctly. > > Going with my assumptions, I wouild simply use the ToString() method > of the DateTime instance to output the format I need : > > Dim s As String = myDateTime.ToString("yyyy-MM-dd HH:mm:ss") > > On Jan 11, 4:50 pm, ND <[email protected]> wrote: > > > > > I need output timestamp as 2009-01-09 00:00:00 format, in 24 hour > > format > > > I am forming the result with below row: > > > strcreatetimestamp = (((DateTime)(datarow.ItemArray > > [13])).GetDateTimeFormats()[5] + ((DateTime)(datarow.ItemArray > > [13])).GetDateTimeFormats()[110]) ; > > > but, with this I am getting Something like: 2009-01-09 02:00:00 AM > > > I guess the incorrect output could be because of culture settings en- > > us to use GetDateTimeFormats)[] function, how can i determine which > > culture is being used on the server. this is coded inside exe which > > runs on a server. > > > please suggest any possible workaround at this stage without need to > > modifying code and get the required output format. > > > Please correct me if any of above assumptions are incorrect > > > Thanks in advance.- Hide quoted text - > > - Show quoted text -
