Can one modify a column's datatype using a very specific conversion format?   For example, when converting from datetime to varchar I'd like to use the yyyy-MM-dd hh:mm:ss format, not the system default which is 109 I believe.  Is there any way to achieve this without creating a temporary column?
121927
When you attempt to CAST a DATETIME as VARCHAR in SQL Server, the default date formatting style is a fairly inaccurate date format that loses the precision of both seconds and milliseconds. For example:  SELECT CAST(GETDATE() AS VARCHAR) -- May  8 2015  9:13AM   Is there a way to change the default style used? For example, I would like to use style 126 so that the results look more like this:  SELECT CAST(GETDATE() AS VARCHAR) -- 2015-05-08T09:14:19.437   If possible, I would like to only change the default style for the current process or statement; however, I am also willing to change it at the database or schema level.  I should note: I am aware of CONVERT and the ability to manually specify the style. However, in this particular situation, I am unable to use CONVERT. I am CASTing a SQL_VARIANT parameter to a scalar-valued function as VARCHAR.
122443
I need to convert a value which is in a DateTime variable into a varchar variable formatted as yyyy-mm-dd format (without time part). How do I do that?
110548
Is it possible to customize data (or date-time) format in Windows (I am using Windows&nbsp;XP)?  The current format which is followed by the OS [to show date-modified, etc.] is MM/DD/YYYY or M/D/YYYY, whereas I have been comfortable with DD/MM/YYYY or D/M/YYYY format. I am finding it hard to refer Date-modified [which I use often] of files and folders.
24518
Is it just that nvarchar supports multibyte characters? If that is the case, is there really any point, other than storage concerns, to using varchars?
121040
I expect the column to be a VARCHAR2, in my Oracle Database.  US Zips are 9.  Canadian is 7.  I am thinking 32 characters would be reasonable upper limit  What am I missing?  [EDIT] TIL: 12 is a reasonable answer to the question Thanks to everyone who contributed.
122568
My system uses the date format dd-MMM-yyyy. Most of the dates on SE/SO sites are formatted as MMM-dd-'yy.  Having only 'yy makes it especially hard to search for years. yyyy would make that a lot easier.  It would be really cool if this became user-configurable; I personally like the ISO 8601 format very much.  No matter what, the default should change; only about 33% of SE users are from the USA, and only about 20% of SO users are. So it makes sense to go for a form of DMY, as that is what most of the world uses.  Edit:
38011
I am developing a PHP application in which I am in need to store values bigger than 1 million, but with the flexibility of having floating points. I know the traditional float and double. I am looking to store only up to two decimal points, and will only handle operations with numbers that have 2 decimals exclusively.  I have chosen my column type of double and unsigned, but whenever I store a row with a value bigger than one million, it gets truncated to 999999.99  Why is this? I am looking for the right datatype/solution. If you could point me in the right direction, I will appreciate it a lot!  Thank you for your time in advance!  Cheers.
63369
Does any one know how I can specify the Default value for a DateTime property using the System.ComponentModel DefaultValue Attribute?  for example I try this:  [DefaultValue(typeof(DateTime),DateTime.Now.ToString("yyyy-MM-dd"))] public DateTime DateCreated { get; set; }   And it expects the value to be a constant expression.  This is in the context of using with ASP.NET Dynamic Data.  I do not want to scaffold the DateCreated column but simply supply the DateTime.Now if it is not present.  I am using the Entity Framework as my Data Layer  Cheers,  Andrew
79083
I have a lot of nodes that need to get their input format changed - I could do that by hand, but then I won't be done before Christmas 2014.   Where is Drupal storing that information? How can I change the input format in a split second, with an SQL query?
119405
Does anyone know how to convert string time formats in ArcMap v10.2 from 12-hour to 24-hour using a simple query in the Field Calculator? i.e. NO Python, NO editing in Excel, NO changing my Windows PC settings, etc...  This is a successful calculation I used (which I found on a discontinued forum) to convert my dates from MM/DD/YYYY to YYYY/MM/DD:  year([DateFld]) &amp; "/" &amp; Month([DateFld]) &amp; "/" &amp; Day([DateFld])  Perhaps there is some sort of modification that I could make to the above calculation that would change my times to 24-hour?  I've searched for an answer everywhere and played around with it without any luck, but I would like for the times to be in h:mm:ss format.  Forgot to mention that this is a regular shapefile, not part of a GDB.
89437
How can I convert a string to a date time object in javascript by specifying a format string?  I am looking for something like:  var dateTime = convertToDateTime("23.11.2009 12:34:56", "dd.MM.yyyy HH:mm:ss");
99429
Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format  Sun, 06 Nov 1994 08:49:37 GMT   Using strftime does not work, since the strings are locale-dependant. Do I have to build the string by hand?
11883
How can I format a date as dd/mm/yyyy or mm/dd/yy ?   Like in VB format("dd/mm/yy",now)  How can I do this in C#?
96922
Why when I save a value of say 40.54 in SQL Server to a column of type Real does it return to me a value that is more like 40.53999878999 instead of 40.54?  I've seen this a few times but have never figured out quite why it happens.  Has anyone else experienced this issue and if so causes it?
63278
In my locale, date is inserted as dd/mm/yyyy or variations of that (including dd-mm-yy). I made an Excel form (in normal Excel file), already formatted to show date as dd/mm/yyyy, but when I typed "05/04/2015" it will be shown as "04/05/2015". I know this can be solved by changing the regional setting to my local setting, but I need to distribute this form to a lot of people with no knowledge of changing regional setting, and assuming no one can teach how to, hence my question :  Is there any way to input "05/04/2015" and be recognized as "5 April 2015", without having to change regional settings ?  Additional note: When I mean "4 May 15" (typed in 4/5/15), Excel will recognize this as "5 April 15" because Excel takes input as "mm/dd/yy" format. I need to change the default behavior of Excel to take as "dd/mm/yyyy" as this is the way the users will input.  If possible, the setting should also included/embedded on the file to allow end-users use the form without even changing setting.  I'm not familiar with macros and VBA, but willing to try those :)  EDIT : this is related to my question :   but I don't need to change the whole formula bar, as long as Excel recognize that I'm typing in dd/mm/yy format.
80089
I have seen a solution that I don't get to work - I need to change data type from string to integer and I did what is shown i the image below Can someone point out what I do wrong?
106168
I need to add 30 minutes to values in a Oracle date column.  I do this in my SELECT statement by specifying   to_char(date_and_time + (.000694 * 31)  which works fine most of the time.  But not when the time is on the AM/PM border.  For example, adding 30 minutes to 12:30 [which is  PM] returns 1:00 which is AM. The answer I expect is 13:00.  What's the correct way to do this?