In my system the date format is set as YYY-MM-DD format.So my c# application will take this format when i call DateTime.Now which is fine.
Now in installed my application as service using Install util command.
After running services it gets the date format as dd/mm/yyy.
But i want to save the format as yyy-MM-DD format in database.
Whether i need to change my code or i can set this format in system.
because already the regional settings are done in yyy-mm-dd format only.
This problem happens only when I install my application as a service.
Please help. Thanks in advance.
Use the DateTime formatting:
That will get you: