Hi,

 You can use

Dim curdte As DateTime
curdte = Now()
Response.Write("dd-MMM-yyyy : " & curdte.ToString("dd-MMM-yyyy"))

for more formats  refer to below link

http://harikaworks.blogspot.com/2009/01/date-time-format-in-aspnet.html




On Sun, Jan 11, 2009 at 7:29 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.
>

Reply via email to