Formatting automated date input

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I'm using the following code below to automatically input date on a field. It's working but the current format is "MMDDYY" and I want it to be "DDMMYY". 

var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])

 & "&_fid_89=" & ToText(Today());

I've changed preferences and checked computer settings but it's still showing the wrong format. Please help. Thanks.

Photo of Jean-Christer

Jean-Christer

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of Blake Harrison - DataBlender

Blake Harrison - DataBlender, Champion

  • 100 Points 100 badge 2x thumb
What is your thinking behind inserting the date as text?
Photo of Jean-Christer

Jean-Christer

  • 0 Points
Thank you for the response Blake but Quickbase seems to have corrected it automatically. All is well now!
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,884 Points 5k badge 2x thumb
Hi Black,

Can you give me some idea about this format -  MMM/DD/YYYY

Actually default format of date is MM/DD/YYYY but i want to show in some case date as - Mar 30, 2016.


Regards,
Gaurav
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Day(Today())&"/"&Month(Today())&"/"&Year(Today())
Hi Jean-Christer,

in app settings under app properties you can adjust the date formatting.

see below.
Photo of Jean-Christer

Jean-Christer

  • 0 Points
Thank you for the suggestion Leo! It's working perfectly now thank you!
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,884 Points 5k badge 2x thumb
Hi Scott,

it is still showing me as 3/8/2016. but i want date as : March 8,2016

Thanks,
Gaurav
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Hi Gaurav,

Use the following in your formula - text field:


var text month = Case(Month(Today()),
"1","January",
"2","February",
"3","March",
"4","April",
"5","May",
"6","June",
"7","July",
"8","August",
"9","September",
"10","October",
"11","November",
"12","December");

$month&" "&Day(Today())&", "&Year(Today())



----

That should sort you out!
Hi Gaurav,
You can also go into the field settings and under "Display", "Format" you can select "Show the month as a name" checkbox. This formatting option applies to all date fields, formula or otherwise.
Best,
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,884 Points 5k badge 2x thumb
Hi Leo,

I have a formula date field in which i have also check the checkbox "Show the month as a name".
But still it is showing numeric.

Thanks,
Gaurav Sharma
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,884 Points 5k badge 2x thumb
Hi Scott,

I have tried but still showing as previous.

Here is my formula:

var date validity = AdjustMonth([Return Date],6);

var text month = Case(Month($validity),
1,"January",
2,"February",
3,"March",
4,"April",
5,"May",
6,"June",
7,"July",
8,"August",
9,"September",
10,"October",
11,"November",
12,"December");

$month&" "&Day($validity)&", "&Year($validity)


Regards,
Gaurav Sharma
Hi Gaurav,

I just confirmed, this works on my end. If you want to reach out to me at Leo@workablesolutionsllc.com I can send you a screenshot as I am unable to attache one to a comment.

Best,
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,884 Points 5k badge 2x thumb
Sorry Scott,

I dont know what happened that time but it works perfectly.

Thanks,
Gaurav Sharma
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,884 Points 5k badge 2x thumb
Hey Leo,

Thanks for your help.
I figure out this because i am using this date field in formula Text field.
I use this field on form then, it shows me month name but not showing in formula text field.

Thanks,
Gaurav Sharma
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
You're welcome Gaurav.  Let me know if you require additional help.  My contact information is found through my profile.

Scott