Why fn:current-date()/fn:current-time() return incorrect time in OSB 11gR1?
+system: Oracle Service Bus Version: [Oracle Service Bus Server Side Dependencies 11.1 Fri Mar 19 01:02:35 EDT 2010 ], Oracle Weblogic Server Version: [WebLogic Server 10.3.3.0 Fri Apr 9 00:05:28 PDT 2010 1321401 ] on my local machine (localhost), windows xp professional sp2, firefox 3.0.1.+
in a SOAP 1.1 proxy, i have the following expression in an "Assign" action:
<soap-env:Header>
<wsse:Security>
<wsu:Timestamp wsu:Id='{fn:concat("Foo-",fn-bea:uuid())}'>
<wsu:Created>{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")}</wsu:Created>
<wsu:Expires>{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() + xdt:dayTimeDuration("PT15M") ), "Z")}</wsu:Expires>
</wsu:Timestamp>
<wsse:BinarySecurityToken ValueType='Bar' EncodingType='wsse:Base64Binary' wsu:Id='{fn:concat("FUBAR-",fn-bea:uuid())}'>{if(empty($token//TOKEN/text())) then "123" else $token//TOKEN/text()}</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>i expect that expression to create a SOAP header with the creation time as the current time at which the header is constructed; and then the expiration 15 minutes after the creation time.
i ran it through osb's "XQuery Expression Testing console" at 13:37 (GMT) on monday oct 18. this is what was output:
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<sec:Security xmlns:sec="http://schemas.xmlsoap.org/ws/2002/xx/secext">
<oas:Timestamp oas:Id="Foo-1164f4d1-5cfa-44b4-99b0-e15d3ec29f94" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<oas:Created>2010-10-17T12:37:12Z</oas:Created>
<oas:Expires>2010-10-17T12:52:12Z</oas:Expires>
</oas:Timestamp>
<sec:BinarySecurityToken ValueType="Bar" EncodingType="wsse:Base64Binary" oas:Id="FUBAR-639e7e1e-0b1d-47ef-9c98-cf3beb327e3c" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
lorem ipsum dolor sit...
</sec:BinarySecurityToken>
</sec:Security>
</soapenv:Header>the date is 1 day behind (sunday, oct 17)! and the time is one hour behind!
my workstation's clock is set correctly. it's set to "Automatically adjust clock for daylight saving changes". I'm in the GMT timezone. the osb/wls stdout console window and logs all show the correct date and time.
if i run the "current-date()" and "current-time()" functions through XML Spy 2001's XPath engine, it outputs the correct date and time.
what gives? anybody know what's wrong?
i've come across a few other similar threads. i've found the MLR #16 patch referred to in some of those posts. but unless i'm mistaken, it looks like that particular patch is for OSB 10.1.x.x.x; and i'm using 11.1. so i would have thought that 11.1 would have that patch anyway. no?
i'm completely stumped!
thanks in advance for your time and help.
turns out that wrapping current-date in "fn:adjust-date-to-timezone()" is Zone related date time conversion problem with fn-bea:dateTime-to-string...
there's also an "adjust-time-to-timezone()" and an "adjust-dateTime-to-timezone()". who knew?
if anybody else has any other solutions, i'm all ears.
Similar Messages
-
GetDuration().getSeconds() returning incorrect time
The method I am calling creates a Player object with a specified file, gets the duration using getDuration(), then it gets the seconds using getSeconds(), and then toTime() takes the seconds and converts it into mm:ss. The problem is the time returned isn't the correct duration of the song. For example, I am getting 3:27 returned when the song is actually 2:17.
I am calling this: toTime(getPlayer (file).getDuration().getSeconds()){code}
{code:java}private String toTime(double seconds) {
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.add(Calendar.MILLISECOND, (int)(seconds * 1000));
SimpleDateFormat format = new SimpleDateFormat("mm:ss");
return format.format(calendar.getTime());
private Player getPlayer(File file) {
Player player = null;
try {
player = Manager.createRealizedPlayer(new URL("file:///" + file.toString()));
return player;
} catch (MalformedURLException ex) {
ex.printStackTrace();
} catch (CannotRealizeException ex) {
ex.printStackTrace();
} catch (NoPlayerException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
return null;
}{code}
Any idea why I'm not getting the correct duration?>
Is there any other way to get an accurate duration?>How important did you say this was to you?
I note that you have not added any dukes
to this thread, as I advised. Dukes can be
added to a thread at any time.
In the hope that you can take my rather not
subtle hints, I did some digging around and
discovered the following...
OK - there is some bad news, more bad news,
and a possible (vague) glimmer of hope.
First, the bad news..
1) <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4533590>
This 'In progress, bug' from November 2001
relating to jumping forward through a VBR MP3
does not bode well, nor the fact that..
2) JMStudio will also show incorrect times
for VBR MP3's (OK - hardly surprising).
OTOH, the 'vague glimmer of hope' comes from
an idea I just had, which is to implement a
pass-through codec..
<http://java.sun.com/products/java-media/jmf/2.1.1/apidocs/javax/media/Codec.html>
..that accepts the MP3 frames, caches them and
converts the result to something that is not
VBR, so an accurate time can be calculated. I
am not entirely sure I have understood the JDocs
though, and even if it is possible, the codec
is going to need to cache a large amount of data
(the entire tune).
If you can get this working, I suspect you will
be the first to crack this problem.
Having said all that, if this is a student
project, I would recommend ignoring VBR MP3s
& supplying the app. complete with a few
(polite cough) 'example' media files that
do not include any VBR MP3s.
OTOH, if you try the codec approach and manage
to make it work, I would recommend including
only VBR MP3s, and heavily stressing to the
assessor that the 'envelope* was pushed, and
indeed broken' with this application.
* 'envelope' in the sense of a barrier or
obstacle. -
Current date & time in text field
I need to auto-fill a text field with four letters plus the current date and current time. The text field should populate when the user clicks a checkbox.
For example, if today is April 25, 2012 and the current time is 10:27 a.m., the text field should read: UNIS0425121027. (The time can be in military time or not - it doesn't matter.)
Thank you in advance for any help you can offer.Try the following in the initialize event of the text field.
Change the script language to FormCalc.
TextField1.rawValue = Concat("UNIS",Num2Date(Date(),"MMDDYY"),Num2Time(Time(),"HHMM"));
Thanks
Srini -
Display current date and time in a Input text field.
Hi,
I am new in ADF trying to convert the Oracle Forms to ADF. I have questions how can I display the current date & time in the input text filed when ever the page opens .
Thanks in advance.Hi,
Check followings will useful
current date setting
Current Date -
A script for adding the current date to file name?
I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?
ok, I ended up with this test routine:
on adding folder items to this_folder after receiving added_items
tell application "Finder"
repeat with this in added_items
my checkifopened(this)
display dialog (name of this) as text
end repeat
end tell
end adding folder items to
on checkifopened(this)
set a to POSIX path of (this as alias)
repeat until 1 = 0
## don't like that one because it relies on an error msg ... so
(** try
set b to do shell script "lsof | grep " & quoted form of a
on error
exit repeat
end try**)
##so I use this one
set b to do shell script "lsof"
if b does not contain a then
exit repeat
else
say "still opened"
end if
end repeat
end checkifopened
this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
And after adding a timeout (just in case) to this function the final script looks like this:
on adding folder items to thefolder after receiving added_items
tell application "Finder"
set folderkind to kind of thefolder
set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
repeat with myfile in myfiles
set myfile_datestring to my get_datestring(creation date of myfile)
set myfilename to name of myfile
if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
set filestatus to my checkifopened(myfile, 60)
if filestatus = false then
display dialog "timeout on folder action"
else
set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
set name of myfile to myfilename
end if
end if
end repeat
end tell
end adding folder items to
on get_datestring(mydate)
return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
end get_datestring
on checknamewith_pdfsuffix(n, D, looped)
--check if filename exists in D
-- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
#n = string of the filename
#D = file reference to the directory to check
#looped = boolean used for recursive loop...
tell application "Finder"
set thefiles to name of every item of (D as alias)
end tell
if thefiles contains n then
if looped = false then
set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
my checknamewith_pdfsuffix(n, D, true)
else
set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
set tmpcount to (count of characters of (tmp as text)) + 5
set tmp to tmp + 1
set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
my checknamewith_pdfsuffix(n, D, true)
end if
else
return n
end if
end checknamewith_pdfsuffix
on checkifopened(this, mytimeout)
## this file reference
## timeout in seconds
set a to POSIX path of (this as alias)
set startdate to current date
repeat until 1 = 0
## don't like that one because it relies on an error msg ... so
(** try
set b to do shell script "lsof | grep " & quoted form of a
on error
exit repeat
end try**)
##so I use this one
set b to do shell script "lsof"
if b does not contain a then
return true
else if ((current date) - startdate) > mytimeout then
return false
else
##say "still opened"
end if
end repeat
end checkifopened
to use this save this script in /Library/Scripts/Folder Action Scripts
and add this as a folder action to your folder...
The script processes all files inside that folder each time a new files is added... -
Error in Current Date in XSLT Mapping
Hi Experts,
I am having a problem in Dispaying the current Date and Time ( or System Date and Time ) .As per my Project Requirements I need do XSLT mapping
My XSLT Mapping Looks like
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://XYZ.eu.ABC.com">
<xsl:template match="/">
<a:A2A>
<a:PNo>
<xsl:value-of select="Path/Path/PNO"/>
</a:PNo>
<a:Rev>
<xsl:value-of select="Path/Path/REVISION"/>
</a:Rev>
<a:Current Date>
<xsl:value-of select= ""/>
</a:Current Date>
<a:Current Time>
<xsl:value-of select= ""/>
</a:Current Time>
</xsl:template>
</xsl:stylesheet>
Can any one please let me is there is any function to dispaly the Current Date and time.Hi ..
I just tried executing both the maps.. Both of them excutes well in both XMLSpy and Stylus Studio .. But having below problems in Executing in PI
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/aaa">
<xxx>
<xsl:value-of select="current-dateTime()"/>
</xxx>
</xsl:template>
</xsl:stylesheet>
Then I got the error
javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: Function with name 'current-dateTime' not found in context library.
with
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:datetime="http://exslt.org/dates-and-times"
exclude-result-prefixes="datetime">
<xsl:template match="/">
<currtime>
<xsl:value-of select="datetime:dateTime()" />
</currtime>
</xsl:template>
</xsl:stylesheet>
I have got
Unable to find resource http://exslt/org/dates-and-times.class (http://NAMESPACE Name) in the following software component versions: 0fe18820-410a-11dd-979b-dc8591374305 -
Hi,
I had searched on SDN already and tried few codes without success.
If somebody had already worked on current date function in XSLT mapping version 1.0, please share it.
Thanks in advance,
Venkat.
PS: links I already referred.
http://www.w3.org/TR/xpath-functions/#func-current-dateTime
Error in Current Date in XSLT Mapping
Re: XSLT Mapping - Getting current date in XSLT version 1.0
Re: Current date in xslt mappingHi,
XSLT 1.0 does not provide any standard way to get the current date/time. You can call an extension function to do it (depends on your processor), or you can pass it to the stylesheet as the value of a parameter.
current-date() and current-time(). For XSLT 1 you'll have to use the dates-and-times EXSLT extension package. Here's a usage example for XSLT 1:
<xsl:stylesheet xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex">
<xsl:value-of select="ex:date-time()"/>
</xsl:stylesheet>
Refer this for
http://www.exslt.org/date/index.html -
Facing issues with 3g Mobile Data Usage Current Period and Apps Volumes are differ.
Hi All,
i am facing some data mismatch with my iphones. the actual mobile data usage volume and data usage for Apps volumes are showing different data.
for eg : Mobile Data Usage - Current Data Usage - Current Period volumes showing 342 MB but if i check the Use Mobile Data For Apps Volumes for all Apps including System Service Data's and Uninstalled Data's are showing very less ( around 200 MB only ) compare with Current Period Volumes.
Mobile Data Usage - Current Data Usage - Current Period and Use Mobile Data For Apps ( Apps wise data usage ) Data's are not matching..
Please let me know will it show like that only or its an issue ???? if you want i can share the screen shot as well.Hello kasinathadurai,
Welcome to the Apple Support Communities!
I understand that you have some questions about cellular data usage and apps that use cellular data. For this question, I would refer you to the attached article that will help explain how data usage, call time, and app cellular data is calculated.
Learn about cellular data settings and usage on your iPhone and iPad (Cellular Model) - Apple Support
Have a great day,
Joe -
Current date - user entered days
Hi all
I have this scenario:
I have safety stored as attribute of material.
I have to do some calculation based on this so i created a replacement path variable and used replace with attribute value.
Now i have 2 safety stock:
1. Current ( safety stock restricted to current date )
2. Safety stock Past : restricted to (current date - User entered no of Days).
How to calculate the second one in 2004s??
ThanksHi Srini
Thanks for quick response. here is the issue. The safey stock needs to be calucated for just that day. so it not aggregated from current date- user entered days to current date.
ex:
Current Safety Stock (10/26/2007) Safety past (10 /26/2007 - 7 days) ( user enters 7 days)
100 200
So how to restrict Safety past to the date which is current - user enetered no of days.
Thanks
Pankaj -
XQuery function : Adding day to current date
I have a requirement to add 1 day to the current date during the Xquery transformation.
Does anyone know if there is any xquery function that does that?
From this link,
http://download.oracle.com/docs/cd/E13214_01/wli/docs92/xref/xqdtopref.html#wp1162860
it seems like there is a function, op: add-yearMonthDuration-to-dateTime, that serve this purpose, but I don't find it in OSB console IDE nor OEPE.You can use the below expression for adding 1 day (24 hrs) to a given current date:
fn:current-dateTime() + xdt:dayTimeDuration("PT24H")
Thanks,
Patrick -
I have Elements 11. Sometimes, if I edit a photo in Elements Editor, the date gets changed to the current date. Why does that happen? It doesn't happen all the time, so I can't isolate the cause. Any ideas?
I have Elements 11. Sometimes, if I edit a photo in Elements Editor, the date gets changed to the current date. Why does that happen? It doesn't happen all the time, so I can't isolate the cause. Any ideas?
-
As of version 31, why is there still no Thunderbird option to QUICKLY insert current date and time in message that you are writing?
Literally have seen this very-much-needed -- and used -- option "promised" for three years now, and even if there's only one or two formats that could be used, at least the option is there.
It seems only way is to link a Macro and tool to Thunderbird and do it that way.
Joe Rotello
[email protected]
Skype: joerotelloWhere was it promised? A quick search of Bugzilla didn't find a functionality request bug report for it.
I assume you're aware that Mozilla stopped development about 2 years ago (just adds security/stability fixes and provides infrastructure) and all new features and bug fixes are now added by the community. They seem pretty tied up with bug fixes and reworking some hard to maintain components such as the MIME support.
Have you tried the Timestamp add-on at https://addons.mozilla.org/en-us/thunderbird/addon/timestamp/ ? The version at AMO doesn't support versions later than 2.0 so you'd need to do something like install the disable add-on compatibility checks add-on at https://addons.mozilla.org/en-us/thunderbird/addon/checkcompatibility/?src=ss, and ignore the warning message about Timestamp not being compatible. However, the author has a version at http://extensions.sanjer.nl/?page=tb_ts that supposedly supports up to Thunderbird 11.9.x so it should be "compatible by default as it supports version 5 or later and is not a binary add-on like Lightning or Enigmail.
"For Thunderbird use the context menu (right click popup) in the compose window, Ctrl+Shift+T or "Options | Insert timestamp" to inserts the date/time into a message" -
Problem with getting current date and time using oracle.jbo.domain.Date
I`d like to get current date and time using oracle.jbo.domain.Date method getCurrentDate(), but it always return current date and 12:00:00. I also need to get the current time.
I think you should use java.sql.Timestamp domain.
(And set database type to TIME or DATETIME.)
Jan -
How to get Client(browser) current date/time in BIP report
Hi,
I need to display report generated date in BIP report and this should be client(browser) current date/time. I tried the following things.
1. have used MS Word Native Date/time using Insert->Date/Time. And we have chosen the M/d/yyyy h:mm:ss am/pm format. but it is printing BIp server date/time, not client date/time.
2. <?xdofx:sysdate?>, <?xdoxslt:sysdate_as_xsdformat()?> and <?format-date:xdoxslt:sysdate_as_xsdformat();'SHORT_TIME'?> are giving GMT Date/Time, but we need client Date/Time.
3.<?xdoxslt:sysdate('DD-MON-YYYY HH12:mi:ss')?> is giving the system date/time of the machine where BIP server is installed.
Could you provide some help in this??
Thanks
HariHello, Hari,
what would return something like this:
Execution date:
<?xdoxslt:current_date('ja-JP', 'Asia/Tokyo')?>
<?xdoxslt:current_time('ja-JP', 'Asia/Tokyo')?>
@Vetsrini,
for my opinion,
in the countries where time is switching (winter/summer) using the hard coded time zones in the format-date() cause a problem:
for example:
if we enter the date in date prompt in summer it will return PM_DT = 2010-07-20T00:00:00.000+04:00
in winter 2010-07-20T00:00:00.000+03:00, so,
using <?format-date:PM_DT;'DD.MM.YYYY';'GMT+3'?> return 2010-07-20 in winter and 2010-07-19 in summer.
regards,
Eldar A. -
Put the current date and time in a string
I am having trouble trying to put the current date and time from my Calendar object into a string
any ideas?Calendar timeCal = Calendar.getInstance();
timeCal.setTime(new Date(System.currentTimeMillis() - startTime ));
String date = formatToTwoDigits(timeCal.get(Calendar.HOUR_OF_DAY)) + ":" +
formatToTwoDigits(timeCal.get(Calendar.MINUTE)) + ":" +
formatToTwoDigits(timeCal.get(Calendar.SECOND));
private String formatToTwoDigits(int i) {
String ret = null;
i = i % 100;
if (i < 10) {
ret = "0" + Integer.toString(i);
} else {
ret = Integer.toString(i);
return ret;
You can figure out yourselve how to display the date, use other Calendar.XXX properties.
Good luck!
Maybe you are looking for
-
Can I have multiple incoming servers for one email address on mail?
I am currently trying to connect my school email address to my Mail app on my Mac. Unfortunately, it seems that when connected to the school network, I can't access the Microsoft Exchange Web sever, whether through any web browser or Apple Mail, but
-
How to make smb:// links open directly in Finder?
Hello, When I click on an afp or ftp link (such as ftp://abcd.defg.com/xyz/ or afp://mac.local/xyz/), in my emails (Eudora), the request is transmitted to the Finder, and I end up with a window opened in the /xyz/ folder. This is the case because the
-
PDF printing and APEX Listener.
Hi, I noticed in the Application Express statement of direction, dated February 2, 2010, the section regarding the Application Express Listener stated "improved PDF printing". I construed (possibly misconstrued) this to mean the APEX Listener might i
-
Itunes store does not open on p c. Windows Vista. Everything has been tried. Uninstalling - reinstalling iTunes. Support iTunes. Phone support iTunes. Windows troubles scan. Store start to connect and then stops. Who can help???? Greetings.
-
Service Tax Registration Number
hi all, Where can i incorporate the Vendor's Service Tax Registration number in the Vendor Master. I am working in CIN - Country India Version. I can see a column in the table J_1IMOVEND, Service tax regn. no. How does it get populated. thnx regards