I have model which has date in DD/MM/YYYY format i.e how it is saved in DB format.
Now while displaying to german user I Convert it DD.MM.YYYY and show it in textbox. But while saving back to DB i need to convert it in old format.
As i am using angular the new date is updated in model.
Could someone suggest or give some mock code for this.
Related
There is a createdDate field in Datetime standard Salesforce format for case I want to change it to dd-mm-tyyyy format actually I am showing list of case in flow for that I have created an apex class now it is default format that is yyyy-mm-dd so I need to change it dd-mm-yyyy
Change the user’s locale to one that uses the desired date format. The Salesforce UI renders date time values in the time zone and locale format of the current user.
It’s generally not a good idea or a best practice to implement custom date rendering; there’s a wide variety of ways to get it wrong.
When loading a .csv file into BigQuery with dates with this format DD/MM/YY it doesn't work, if I specify the schema for the table and I select Date Format.
However, if I don't specify the schema and I choose Automatically detect it works and converts the date format into YYYY-MM-DD.
Is there any possibility of convert the date into the right format manually and specify the name for that field?
Thanks,
David
Unfortunatelly, there is no way to control date formatting from the load API. You can load data into STRING first, and then use Standard SQL's PARSE_DATE function to parse it using any custom format.
Can someone give a tips. How can i control format datetime for saving in db for my datetimefield with auto_now. It is saving in form YYYY-MM-DD HH:MM but i need that in database my entry looks like this 10/14/2015 1:34:54 AM.
I created a "Date" field and its format defaulted to MM/DD/YYYY (English). I changed the Date settings in "/admin/config/regional/date-time" to use DD/MM/YYYY and added another "Date" field, which uses that format. Now I have two fields with two different date formats and I have no clue how to set them both to DD/MM/YYYY.
Any idea ?
I believe your best practice would be:
converting your corresponding database tables
exporting these tables
deleting this field form your site
running cron
creating this field from scratch and setting it to use your new format
overwriting your corresponding tables with the converted (original) tables in DB
You need to convert your tables after you have saved them. You can not change them once you have them, only conversation works normally.
I have written a stored procedure in SQLServer which accepts 2 parameters, both in dateTime format. The idea of the stored proc. is for the user to be able to search for specific cases between 2 different dates. The users are imputing the dates in mm/dd/yyyy format, and this returns data properly.
Now I need to turn this into a Crystal Report. I set up the report to use the Stored Procedure that I have written. When Crystal asks for the values of the 2 parameters, it will not accept them as mm/dd/yyyy format. It is trying to get me to put them in yyyy-mm-dd hr:mn:scds format.
Is there a way I can set up the report to accept the parameters as mm/dd/yyyy format?
Thanks in advance.
As far as I know you cannot control input format for the date parameters
In crystal report, you can right click the date variable and go to format, then choose the way you want the date to appear.
If the date is obtained correctly from the database, you can display it as you wish by changing the format.
Crystal Reports uses the datatype in the Stored Procedure. If you have a Date in your SProc Crystal will treat the value as a string and not display the calendar icon in the parameters popup. Solution is to change the Date to DateTime in your sProc and Crystal will display the calendar icon and format as yyyy-mm-dd automatically if your user clicks on the calendar icon. I know you probably want a DATE not DATETIME but use DATETIME I don't believe there is any other answer.