Trying to create a file output with date extension yyy-mm-dd etc. Cloud workflow does not have the date format functions of bigquery.
Closet I could get is ${time.format(sys.now())}, but that provides a timestamp.
Any way to parse to required format.
I suppose you mean a date extension in this format yyyy-mm-dd (your question says yyy-mm-dd).
${time.format(sys.now())} is giving me a timestamp like this:
2022-10-22T18:39:05.570539Z
With the text.substring() function ${text.substring(time.format(sys.now()), 0, 10)} I'm getting this string:
2022-10-22
Related
I've imported a CSV file in AWS Databrew. By default, it has converted every date-time column in string. I need to check whether a field is in date-time format or not. When I'm trying to convert "Source" column into "timeStamp" format, it's giving null, for fields having time(hours) in single digit. Can anyone pleae tell me how to resolve this issue ?
In U2/Universe/Pick, there is a function ICONV("11/11/15","D") to convert an external date to an internal date but this will work in USA or with the date format mm/dd/yyyy only. How can I use this function for UK date format (dd/mm/yyyy) ?
ICONV("11/12/15","D4/DMY")
output: 17512
According to the UniVerse BASIC Commands Reference documentation, you can also use the following to control the date format:
You can set the default date format with the DATE.FORMAT command. A
system-wide default date format can be set in the msg.text file of the
UV account directory. Date conversions specified in file dictionaries
or in the ICONV function or the OCONV function use the default date
format except where they specifically override it. When NLS locales
are enabled, the locale overrides any value set in the msg.text file.
NLS sets the local date format required so if it is enabled the following does not apply.
The question is, do you want all dates in dd/mm/yyyy format or just for this process. Assuming all dates should be, then setting DATE.FORMAT ON at login will do this. Otherwise you can set it temporarily just for the process and afterwards set it back using DATE.FORMAT OFF.
I have dates stored in datetime in an MSSQL database. In my C++ application, these dates are pulled out of the database and stored in a CString.
I am trying to use COleDateTime's ParseDateTime() to display these dates in a nice format. However I found they are being displayed in american format (MM/DD/YYYY), and sorted as such. I would like them displayed in UK format (MM/DD/YYYY). I have attempted the code below to no difference:
codt.ParseDateTime(sqlresults.GetItem(_T("date"),l),0,MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK));
Thanks!
The ParseDateTime function is used to read the provided value – in your case you get it from the database and set the internal representation of the COleDateTime object.
You are not after this method but rather after the COleDateTime::Format method.
codt.ParseDateTime(
sqlresults.GetItem(_T("date"),l),
0,
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
CString dateAsUkString = codt.Format(_T("%d/%m/%Y"));
// display the dateAsUkString string in your view
I am using Soap-UI to call Oracle-BI web service runReport to generate a report. Its working fine for reports with no report parameters. But when I am passing Date parameters with dateFormatString defined, the report doesn't show any result. Basically, as per my understanding, the web service can't parse the date correctly. Here's what I tried -
<v2:parameterNameValues>
<v2:listOfParamNameValues>
<!--Other parameters-->
<v2:item>
<v2:dataType>Date</v2:dataType>
<v2:dateFormatString>dd-MM-yyyy</v2:dateFormatString>
<v2:name>val_from_dt_in</v2:name>
<v2:values>
<v2:item>01-01-2013</v2:item>
</v2:values>
</v2:item>
<v2:listOfParamNameValues>
<v2:parameterNameValues>
According to oracle docs, the dateFormatString parameter will take any Java date time format string. I have tried dd-MMM-yyyy and yyyy-MM-dd also. But it doesn't work. Can anyone tell me where I am doing wrong?
try this format please:
dd/mm/yyyy
I need to match on a date using the LIKE operator. The date should be in current user's local format, not in the general format.
So I use the strftime function like this:
WHERE strftime('%d.%m.%Y %H:%M', createdDate, 'localtime') LIKE '%{searchTerm}%'
Unfortunately this works only for fixed format '%d.%m.%Y %H:%M'. But I want to use the user's current locale format.
So I need to either:
1) Get the strftime format string from a C++ locale object
2) Make SQLite format the date using current locale itself
Spent already several hours on this to no avail.
Would be grateful if anyone would point me in the right direction on how to tackle this problem.
Example:
Given current locale is German I want to get something like "%d.%m.%Y %H:%m".
For an US locale I want to get "%m/%d/%Y %H:%m"
Normally the local date format can be obtained with the Windows GetDateFormat API (or GetDateFormatEx API for Vista). Your program could interrogate the API then transform the date accordingly. Following that, the date can be recorded in SQLite.
However, once can question the validity of storing timestamps in a specific format. That basically means a lot of code to manipulate each date, or no date manipulation at all. May I suggest, if it is possible, storing in a plain format (say ISO or UNIX timestamp) and working from that, outputing with whichever flavour of GetDateFormat is required?
OK, different answer.
Suppose you have your MyTable:
CREATE TABLE MyTable (
MyPrimaryKeyHnd INTEGER PRIMARY KEY,
...
CreatedDate TEXT);
(Where CreatedDate is in ISO format. I suppose you could also use a Unix timestamp. Your choice.)
Then a list of possible formats
CREATE TABLE TimeFormat (
TimeFormatHnd INTEGER PRIMARY KEY,
TimeFormatString TEXT NOT NULL,
TimeFormatDescriptor TEXT);
You allow your user to chose a format of their choice and keep that in a seperate table or INI file. TimeformatString would be your strftime() compatible format string (such as '%d.%m.%Y %H:%M'). You just need to build your query with whatever the user's choice is.