Day and month being swapped in date field on "?a=API_GenAddRecordForm"

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
I'm using "?a=API_GenAddRecordForm" & "&_fid_41=" & [Date I want] & "&_fid_42=" ...

Field 41 and 'Date I want' are both date fields.
In app properties, formatting of dates is DD-MM-YYYY (I live in Australia).
When the form opens, in field 41, the day is in the month and month is in day from the 'Date I want'.

Thank you.
Photo of Gary Boyd

Gary Boyd

  • 800 Points 500 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 2,266 Points 2k badge 2x thumb
You probably need to write a variable that will format the Date into Australia format using the function ToFormattedText([Date Field],"DDMMYYYY).  Then "encode" the variable in your API call.

ToFormattedText (Date d, Text f)

Description: Returns a Text value containing the formatted print representation of the Date d, using the format f.

Example: ToFormattedText(Date(2000,01,30),"MMDDYYYY")  returns "01-30-2000"
ToFormattedText(Date(2000,01,30),"MMDDYY")  returns "01-30-00"
ToFormattedText(Date(2000,01,30),"DDMMYYYY")  returns "30-01-2000"
ToFormattedText(Date(2000,01,30),"DDMMYY")  returns "30-01-00"
ToFormattedText(Date(2000,01,30),"YYYYMMDD")  returns "2000-01-30"
Photo of Gary Boyd

Gary Boyd

  • 800 Points 500 badge 2x thumb
Thanks I'm sure this will solve it. Seems strange and was a bit concerning that this would happen.
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 2,256 Points 2k badge 2x thumb
I agree that despite setting the Application date-format to a specific format; API Calls do not seem to recognize that.  Imports can be an issue too via Excel.