formating datetime field in progress-4gl - progress-4gl

I want to format a datetime field but i can't figure out the syntactic. I want it to display it to look like this: "mm:dd:yy hh:mm am".

Like this:
display replace( string( now, "99/99/99 hh:mm:ss am" ), "/", ":" ) format "x(20)"

Related

talend format yyyy-MM-dd'T'HH:mm:ss.SSSz to yyyy-mm-dd HH:mm:ss

I am trying to change the date format in txmlmap component but its not working
i want change date format
from yyyy-MM-dd'T'HH:mm:ss.SSSz to yyyy-mm-dd HH:mm:ss
expected output:- yyyy-mm-dd HH:mm:ss
You can parse your string to a date using your source pattern and then format that date to a string using your target pattern:
TalendDate.formatDate("yyyy-mm-dd HH:mm:ss", TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSSz", myDateString))
In almost all coding languages format is text, while date is a double. That means you must first make a date of the first expression, before setting the new format of that date. But in Your case the 'T' is some kind of special format that need to be replaced with a blanck space. I have no idea about what it would look like in talend but in VB it would look like this:
' from yyyy-MM-dd'T'HH:mm:ss.SSSz to yyyy-mm-dd HH:mm:ss
DateTxt = "2022-12-01'T'22:45:10"
DateTxt = Replace(DateTxt, "'T'", " ")
MyDate = CDate(DateTxt)
MsgBox Format(MyDate, "yyyy-mm-dd HH:mm:ss")

Unsure of date format 1200819 but need to convert to 08-19-20

The column is a nvachar(20).
select [shipment_posted_date_arch]
FROM [RxIntegrity].[dbo].[DiscrepancyReport_Receipts]
When I pull this, the date is in this format of 1200819 for that column. I need to convert to normal date.
This seemed to work:
cast(convert(nvarchar(20), (19000000 + CONVERT(int, shipment_posted_date_arch))) as date)

How to convert string to date in talend

I want to convert string
1516270217
to date format
hh:mm dd-MM-YY
You can do that in a tmap for example.
TalendDate.formatDate("hh:mm dd-MM-YY",TalendDate.parseDate("HHmmddMMyy",row21.newColumn))

Hive date format

Anybody converted a date from mm/dd/yyyy hh:mm format to
yyyy-mm-dd hh:mm:ss format using hive query ?
I have a string with date in the / format need to add some duration in it
Do this:
select
regexp_replace('2015/04/15','(\\d{4})\\/{1}(\\d{2})\\/{1}(\\d{2})','$1-$2-$3') as dt
from x;
INPUT:2015/04/05
OUTPUT:2015-04-05
Grab four numeric digits (\d{4}), two (\d{2}), and two more (\d{2}) from the original string and put them in that order seperated by dashes.

Filtering Date column of dataview using Rowfilter

I want to filter my View according to selected date which is in the format "DD/MM/YYYY", but my dataview column has date in "DD/MM/YYYY hh:mm:ss" format.I want to filter the view according to selected date irrespective of time.How do i convert MATCH_DATE column to the format "DD/MM/YYYY" format in RowFilter.
dtFixt.DefaultView.RowFilter = "MATCH_DATE='" & CType(calSeason.SelectedDate,DateTime).ToString("dd/MM/yyyy") & "'"
You can convert the MATCH_DATE column to "DD/MM/YYYY" format in your view, using CONVERT function as follows:
CONVERT(VARCHAR(10), MATCH_COLUMN, 103)
103 is a Date Format Code that converts the any date in "DD/MM/YYYY" format.
For more details on different date formats, refer article Date Formats.