Date format function in xquery - osb
Hi
I want to assign current datetime to </DateTime> node in the following format in an xquery mapping file
<DateTime>2013-09-10T06:49:12Z</DateTime>
I have tried to do it as follows but it gives error
<DateTime>{fn:format-dateTime(fn:current-dateTime(),"[Y01]-[M01]-[D01] T[H01]:[m01]:[s01]:[f01]Z")}</DateTime>
<Destination>ERP</Destination>
<Sender>CRM</Sender>
Thanks in advance... can someone help me on this
You can try this. This will give you the desired format.
fn:concat(fn-bea:date-to-string-with-format("yyyy-MM-dd",fn:current-date()),"T",fn-bea:time-to-string-with-format("HH:mm:ss", fn:current-time()),"Z")
Thanks
Jahangir
Similar Messages
-
Date format function for 5/2/2010 9:46:00 AM?
Hi,
I want to convert date format in dd/mm/yyyy hh:mm:ss AM/PM format.
Any suggestion?
Thanks.You can use:
<?format-date:xdoxslt:sysdate_as_xsdformat();'SHORT_TIME';’GMT-5’?>
Your date must be in ISO format, please read below
Reference:
http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e12187/T421739T481157.htm#4535403
regards
Jorge -
Hi All ,
I need date format in the following format 2009-01-28T09:09:38.0Z...
please let me know how can i get thisThe Z in a time string typically refers to Zulu time or Greanwich Mean Time, so if you need the zulu time you need to convert your date to a timestamp containing time zone information and shift it to GMT time then format the output as required like so:
with sample_data as (select to_date('2009-01-28 9:09:38','RRRR-MM-DD HH24:MI:SS') dt from dual)
select to_char( cast( dt as timestamp with time zone) -- Cast the date to a timestamp containing time zone
at TIME zone 'GMT' -- shift the timestamp to the UTC time zone
, 'YYYY-MM-DD"T"HH24:MI:SS.FF1')||'Z' -- Format the timestamp as a character string
from sample_data; -
Converting date format function
Hi All
I want to convet standard date 20061215 (yyyymmdd) into 15/12/2006 format, can any body help me with this.
kind regards
AnupHi anupam,
1. we can use simple WRITE to variable
concept.
2. just copy paste.
report abc.
data : d1 type sy-datum value '20061215'.
data : s(10) type c.
write d1 to s.
replace all occurrences of '.' in s with '/'.
write :/ s.
regards,
amit m. -
Hi,
Can you pls help me in understanding, whether this date format is supported in OSB YYYY-MM-DDTHH:MM:SS[+/-]hh:mm, is there any datatype need to be used for this requirement. Source application is sending the date in the above specified date format. Please advice on this. what is requird in OSB to pass it to end system.
Thanks.HI,
yes it is working with datetime data type.
Thank you.. -
Custom DBProvider - Date Format Problem
Hi All,
I have created a custom DBProvider that inserted form value into database .
I want date format in "yyyy-MM-dd HH:mm:ss" ..
When I pass date in this format ....
It throws error :
05.31 11:49:43.943 IdcServerThread-3 Exception !csDateParseError,2010-05-25!syUnableToParseDate,2010-05-25!syUnableToFindText,/
intradoc.data.DataException: !csDateParseError,2010-05-25!syUnableToParseDate,2010-05-25!syUnableToFindText,/
at intradoc.jdbc.JdbcQueryUtils.appendParam(JdbcQueryUtils.java:305)
at intradoc.jdbc.JdbcQueryUtils.buildQuery(JdbcQueryUtils.java:174)
at intradoc.jdbc.JdbcWorkspace.buildQuery(JdbcWorkspace.java:745)
at intradoc.jdbc.JdbcWorkspace.execute(JdbcWorkspace.java:639)
Please helpHey,
could share your code part inwhich you save the date, also the date format of your UCM.
cheers,
sapan
Edited by: Swapnil Solanki on Jun 1, 2010 1:07 AM
SYSTEMLOCALE
Type and Usage
Configuration Variables (page -3)
Localization (page -25)
Description
Sets the system locale for the content server.
This setting controls the following:
• localized strings used in the content server interface
• character encoding for web pages
• date/time format
• time zone
• parameters used for full-text indexing
Any of these individual features can be controlled by separate configuration entries or
by changing the settings for the SystemLocale.
This setting can be changed on the Server tab of the System Properties utility. The
defaults for a specific locale can be changed on the Localization tab of the System
Properties utility.
If SystemLocale is not specified as a configuration setting, the SystemDateFormat
(page -779) will be deduced directly from the OS settings in the Java VM instead of
using the content server configuration table settings for the SystemLocale. If
SystemLocale is explicitly defined, then the date/time format from the content server
configuration tables for that locale will be used instead.
The configuration entries VerityLocale (page -889) and Ve r i tyEncoding (page -887)
will still override settings from the SystemLocale, but configuring the SystemLocale
directly is the preferred solution because there are many choices for Ve r i tyLocal e and
VerityEncoding that are not compatible.
SYSTEMDATEFORMAT
Type and Usage
Configuration Variables (page -3)
Date and Time (page -16)
Localization (page -25)
Description
Sets the date/time format for the content server.
Note that there are two types of date formats: one that stores seconds and one that
truncates seconds and stores the date up to the minute. If seconds are used, dates can only
be stored up to the year 2037.
If SystemLocale (page -781) is not specified as a configuration setting, the
SystemDateFormat will be deduced directly from the OS settings in the Java VM
instead of using the content server configuration table settings for the SystemLocale. If
SystemLocale is explicitly defined, then the date/time format from the content server
configuration tables for that locale will be used instead.
The syntax for this format is an extension of the date format functionality provided in
the standard Java class libraries.
Location
<install_dir>/config/config.cfg
Example
Used as a configuration entry to set the standard US date time using the four digit year
format:
SystemDateFormat=M/d{yyyy} {h:mm[:ss] {aa}[zzz]}
Note: See Using Content Server in International Environments for information on date
and time formats. -
As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?
Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.
-
Function module to change date format
hi
is there any function module to change date format from 20080318 to 18.03.2008Hi,
Use this FM CONVERT_DATE_FORMAT Convert date from yyyymmdd to ddmmyyyy format
Regards,
Jyothi CH. -
Function module to convert date format from yyyymmdd to mmddyyyy format
function module to convert date format from yyyymmdd to mmddyyyy format
Hi Rajitha,
Do like this
Data: Var1 type sy-datum,
var2(8) type c.
var1 = sy-datum.
Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
write var2.
Reward Points if this helps,
Satish -
Function module to convert date format to yyyymmdd
Hi All,
Would like to seek for your advice. Is there any function module to convert the date format from mm/dd/yyyy to yyyy/mm/dd? Thanks in advance.
Regards,
Shawn
Moderator Message: Basic date question. Thread locked.
Edited by: Suhas Saha on Dec 30, 2011 12:44 PMHi,
Use the FM CONVERT_DATE_TO_EXTERNAL.
Edited by: emax nagu on Dec 30, 2011 7:53 AM -
Is there any function module to convert the date format
Dear ABAPers,
Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
Thanks & Regards,
Ashok.hi,
create custom function module or copy the below code in the report ..and use it
the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
""Local interface:
*" IMPORTING
*" VALUE(DATE) LIKE SY-DATUM
*" EXPORTING
*" VALUE(FORMATTED_DATE)
*" EXCEPTIONS
*" INVALID_DATE
TABLES: TTDTG.
DATA: BEGIN OF T_DATE,
YYYY(4) TYPE C,
MM(2) TYPE C,
DD(2) TYPE C,
END OF T_DATE.
DATA: DAY(3) TYPE N.
DATA: VARNAME LIKE TTDTG-VARNAME.
IF DATE IS INITIAL.
CLEAR FORMATTED_DATE.
EXIT.
ENDIF.
check document date format
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1.
IF SY-SUBRC NE 0.
RAISE INVALID_DATE.
ENDIF.
MOVE DATE TO T_DATE.
CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
WRITE T_DATE-DD TO DAY.
CONCATENATE DAY ',' INTO DAY.
CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
SEPARATED BY SPACE.
ENDFUNCTION.
the output is :--Convert a DATE field into a full format date eg. March 23, 2000
Regards,
Prabhudas -
Function module to change the date format
hi guys
is there any function module to change the date format
from 08/28/2007(mm/dd/yyyy)
to August 28, 2007.
regards
vamsihi vamsi.,
Use CONVERSION_EXIT_SDATE_OUTPUT to get the month name,
but it will give short form of the month name.
if you want <b>long description of the month</b>,
use this peice of code.
PARAMETERS: V_DATUM(07) TYPE C. "(example input:12-2007)
DATA: V_MON(2) TYPE C,
V_YEAR(4) TYPE C,
V_MONTHNAME(10) TYPE C,
V_FULLDATE(30) type c.
WRITE V_DATUM+0(2) TO V_MON.
SELECT SINGLE LTX FROM T247 INTO V_MONTHNAME
WHERE SPRAS = SY-LANGU
AND MNR = V_MON.
CONCATENATE V_MONTHNAME v_datum+3(4)
INTO V_FULLDATE SEPARATED BY SPACE. "(example output : December 2007)
write: v_fulldate.
<i><b>Reawrd points if useful</b></i>
Chandra -
Is there any function module to convert date format?
Is there any function module to convert date format from mm/dd/yyyy to dd.mm.yyyy or sy-datum?
Hi,
wirte statement converts any date fomat in system date fromat
WRITE w_DateTO w_date_sys.
Regards,
Sriram -
Function module to convert date format
hi all,
i need a function module which will take the input as 09.02.2006(mmddyyy) and the out put should be sep-06. etc.
Thanks & Regards
sureshHi Suresh,
Use the function module 'MONTH_NAMES_GET' to get the month name and then use CONCATENATE to get SEP-06.
You can also check another post which is currently running 'Regarding Date Format'.
Thanks
Vinod -
Function Module to Convert date formate
Hi All,
I need to convert the date formate from ex :01-Jan-2009 into 01-01-2009.
Is there any Function Module for this?
Thanks
Partha.
Moderator message - Babu Kilari is correct - post locked
Edited by: Rob Burbank on Apr 27, 2009 9:36 AMHello Partha,
I wanted to ask you a question. Why did you not search SDN Forums before posting.
I think the time take for posting is higher than the time taken for searching.
Am I right??
Please let me know. I think the question you have posted is very basic
Thanks,
Babu Kilari
Maybe you are looking for
-
How can I restrict X11 apps to my primary display?
The question's in the subject line, but here's why. I have a secondary display attached to my iMac and I find it very useful as a dumping ground for useful ancillary windows and apps. The arrangement of my workspace dictates that the secondary displa
-
Adobe XI Pro Installing Error 1935
I tried to download trial Adobe Acrobat XI Pro but this message keeps appear. I used Chrome to download the Adobe Download Assistant. I have Windows 7. Please help me on this problem.
-
Small fine tuning is required in the calculation
Hi Gurus, BI PM module for the report Schedule attainment filtered for one order. The result supposed to be Total job scheduled = 1, completed orders = 1 and No of orders completed on Schedule = 0. However, the report shows, Total job scheduled =
-
Hi Can any one send me the document that will help to understand the architecture of MVC with examples. Regards Amit [email protected]
-
ITunes 11.1.3.8 ERROR message at startup of iTunes
I get this messate when I start my iTunes. I got it on my old 10.xxx software as well so I removed it, downloaded a recent version and installed it. It doesn't seem like there are any selections that have to be made during the installation process.