c# - SqlDatareader GetValue returning date value acording to system date format -


hi reading value table using sqldatareader, problem is formatting value acording machine date format settings.

for example original date format in source table saved yyyy/mm/dd

when use sqldatareader.getvalue in machine has date set mm/dd/yy atutomatically converted format

is there anyway retrive date value original date formatting intact?

thanks

there no "original date formatting", dates kept internally numbers, not strings.

within sql query, can choose output formatting with

convert(varchar(30), thecolumn, nnn) 

where "nnn" 1 of common date formats listed here: msdn.

personally find page confusing, (more useful) page here: sql server helper. page:

convert(varchar(20), getdate(), 100)  

will return 'jan 1 2005 1:29pm'


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -