Help with a Date Format
Hi --
I am working on a Flash widget using data pulled via XML from
weather.gov
and this is the date returned:
2007-12-07T13:00:00-05:00
I understand this to be 1pm on 12/7/2007 with a time zone
offset of 5 hours
(that is correct for my region) and so the time is 8:00am.
I am trying to figure out the best way to turn a string such
as the above to
a date/time value in Flash Is there a built in method to
parse this? When I
tried
var thisDate = new Date("2007-12-07T13:00:00-05:00")
I got an "invalid date" error.
I could break the string up to its various sections and check
if the time is
prior to 5am make sure I decrease the day when I adjust for
the correct time
zone, etc. but I'd like an easier way to do this if possible.
Thanks
Rich
Nothing is obviously wrong. Are you getting an error? Are you absolutely certain that your bind variable is in the right format?
Justin
Similar Messages
-
Need help with converting date format to decimal in SSRS expression.
Hi all,
I have a decimal data type column with a record in the following format 20150219 --> yyyyMMdd. And I am trying to convert the return value from SSRS date/time parameter to a decimal value.
The TMDTOP column is the decimal data type with date records in yyyyMMdd format.
My return parameter is the following:
=IIf(IsNothing(Parameters!SystemDate.Value),Fields!TMDTSY.Value,CDec(Format(Parameters!SystemDate.Value,"yyyyMMdd")))
When I try to run the report I get the following error:
Failed to evaluate the FilterValue of the DataSet ‘DataSet1’. (rsFilterEvaluationError)
I appreciate if anyone can help me on solving this problem.
Thanks in advance.why casting date to decimal here? Can you explain?
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
I am having trouble getting a numbers spreadsheet to hold different formats in the same column. A column with a date formatted heading will not convert to $ for the cells below. Any suggestions would help.
Hi Wayne,
Thank you for this response. I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.
Kind regards
Paul -
Problem with input data format - not "only" XML
Hi Experts,
I have problem with input data format.
I get some data from JMS ( MQSeries) , but input format is not clear XML.
This is some like flat file with content of XMLu2026.
Example:
0000084202008-11-0511:37<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
...content....
</Document>000016750
Problems in this file is :
1. data before parser <? xml version="1.0"> -> 0000084202008-11-0511:37
2. data after last parser </Document> -> 000016750
This data destroy XML format.
Unfortunately XI is not one receiver of this files and we canu2019t change this file format in queue MQSeries ( before go to XI) .
My goal is to get XML from this file:
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
...content....
</Document>
My questions:
1. Is any way or technique to delete this data 0000084202008-11-0511:37 in XI from this file ?
2. Is any way to get only XML from this file ?
Thanx .
Regards,
SeoHi Buddy
What is the XI adapter using?
If you use inbound File adapter content conversion you could replace these values with none and then pass it to the scenario.
Does that help?
Regards
cK -
Not able to save date column with custom date format. in OBIEE 11g
Hi,
I have migrated one report from OBIEE 10g to 11g. There is a date column with customized date format(i.e. Default format is 'dd-MMM-yyyy' and I have used 'MMM-yyyy').
But when I use this custom format and try to save the report in 11g its giving this below error.
''Catalog object privilege validation failed for user to path /shared/ALM BI/Finacial Results/History Income Statement Detail.
You do not currently have sufficient privileges to save a report or dashboard page that contains HTML markup.
This HTML might be present in column headings, table headings, text views, narrative views, the print header,
or the print footer and must be removed before saving.''
Please let me know what changes I need to do for this.
Regards,
Ambika Nanda.Hi ,
privilage issues...check the security settings once..
Thanks,
Ananth -
Need help in converting date format
Hi,
Need help in converting date format from 'DD-MON-YYYY' to 'YYYY-MM-DD' in an .rtf template as I believe xml publisher supports the date format as 'YYYY-MM-DD' only.
Thanks,
Raj.I got the same problem, anyone know how to solve this problem? I allready found some date functions on http://blogs.oracle.com/xmlpublisher/2008/09/date_functions.html . I also tried <?xdoxslt:month_name(xdoxslt:get_month(xdofx:substr(NEED_BY_DATE, 4,3)), $_XDOLOCALE), 0, 'nl-NL')?>, but then it returns a namespace error (Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.). Anyone know how to fix this?
Edited by: user11165753 on 7-dec-2009 23:50 -
Data Pump issue with nls date format
Hi Friends,
I have a database with nls date format 'DD/MM/YYYY HH24:MI:SS' from where I wish to take export from. I have a target database with nls date format 'YYYY/MM/DD HH24:MI:SS' . I have a few tables whose create statements have some date fields with DEFAULT '01-Jan-1950' and these CREATE TABLE statements when processed by Data pump is getting failed in my target database. These tables are not getting created due to this error
Failing sql is:
CREATE TABLE "MCS_OWNER"."SECTOR_BLOCK_PEAK" ("AIRPORT_DEPART" VARCHAR2(4) NOT NULL ENABLE, "AIRPORT_ARRIVE" VARCHAR2(4) NOT NULL ENABLE, "CARRIER_CODE" VARCHAR2(3) NOT NULL ENABLE, "AC_TYPE_IATA" VARCHAR2(3) NOT NULL ENABLE, "PEAK_START" VARCHAR2(25) NOT NULL ENABLE, "PEAK_END" VARCHAR2(25), "BLOCK_TIME" VARCHAR2(25), "FLIGHT_TIME" VARCHAR2(25), "SEASON" VARC
ORA-39083: Object type TABLE failed to create with error:
ORA-01858: a non-numeric character was found where a numeric was expected
The table create sql which adds a column as ' VALID_FROM DATE DEFAULT '01-jan-1970' ' which I think is the issue. Appreciate if someone can suggest a way to get around with this. I have tried altering the nls of source db to be same as target database. Still the impdp fails.
Database is 10.2.0.1.0 on Linux X86 64 bit.
Thanks,
SSN
Edited by: SSNair on Oct 27, 2010 8:25 AMAppreciate if someone can suggest a way to get around with this.change the DDL that CREATE TABLE to include TO_DATE() function.
With Oracle characters between single quote marks are STRINGS!
'This is a string, 2009-12-31, not a date'
When a DATE datatype is desired, then use TO_DATE() function. -
Hy,
I've got a problem when we insert a timestamp to a db.
When I try to start an insert code I get this error:
SQL-Error: ORA-01830: "data format picture ends before converting entire input string"
Insert into ABC_123("dtstamp") values (to_timestamp('31.05.13 09:30:05,000748000 +01:00','DD.MM.RR HH24:MI:SSXFF'));
with this language settings
National Language Support
National
Language Parameter
Value
NLS_CALENDAR
GREGORIAN
NLS_CHARACTERSET
WE8MSWIN1252
NLS_COMP
BINARY
NLS_CURRENCY
€
NLS_DATE_FORMAT
DD.MM.RR
NLS_DATE_LANGUAGE
GERMAN
NLS_DUAL_CURRENCY
€
NLS_ISO_CURRENCY
GERMANY
NLS_LANGUAGE
GERMAN
NLS_LENGTH_SEMANTICS
BYTE
NLS_NCHAR_CHARACTERSET
AL16UTF16
NLS_NCHAR_CONV_EXCP
FALSE
NLS_NUMERIC_CHARACTERS
NLS_SORT
GERMAN
NLS_TERRITORY
GERMANY
NLS_TIME_FORMAT
HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT
DD.MM.RR HH24:MI:SSXFF
NLS_TIMESTAMP_TZ_FORMAT
DD.MM.RR HH24:MI:SSXFF TZR
NLS_TIME_TZ_FORMAT
HH24:MI:SSXFF TZR
I didn't see the error. Maybe somebody can help me.
Thx
Felixef5fe917-5142-4425-a464-94ab111ed87a wrote:
Hy,
I've got a problem when we insert a timestamp to a db.
When I try to start an insert code I get this error:
SQL-Error: ORA-01830: "data format picture ends before converting entire input string"
Insert into ABC_123("dtstamp") values (to_timestamp('31.05.13 09:30:05,000748000 +01:00','DD.MM.RR HH24:MI:SSXFF'));
with this language settings
National Language Support
National
Language Parameter
Value
NLS_CALENDAR
GREGORIAN
NLS_CHARACTERSET
WE8MSWIN1252
NLS_COMP
BINARY
NLS_CURRENCY
€
NLS_DATE_FORMAT
DD.MM.RR
NLS_DATE_LANGUAGE
GERMAN
NLS_DUAL_CURRENCY
€
NLS_ISO_CURRENCY
GERMANY
NLS_LANGUAGE
GERMAN
NLS_LENGTH_SEMANTICS
BYTE
NLS_NCHAR_CHARACTERSET
AL16UTF16
NLS_NCHAR_CONV_EXCP
FALSE
NLS_NUMERIC_CHARACTERS
NLS_SORT
GERMAN
NLS_TERRITORY
GERMANY
NLS_TIME_FORMAT
HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT
DD.MM.RR HH24:MI:SSXFF
NLS_TIMESTAMP_TZ_FORMAT
DD.MM.RR HH24:MI:SSXFF TZR
NLS_TIME_TZ_FORMAT
HH24:MI:SSXFF TZR
I didn't see the error. Maybe somebody can help me.
Thx
Felix
Insert into ABC_123("dtstamp") values (to_timestamp('31.05.13 09:30:05,000748000 +01:00','DD.MM.RR HH24:MI:SSXFF'));
| | | | | | |
| | | | | | +--????
| | | | | +----SS
| | | | |
| | | | +-----MI
| | | |
| | | +-----HH24
| | |
| | +----RR
| |
| +----MM
|
+----DD
The error message means exactly what it says. Your data format string doesn't account for everything in your data string. -
HT3345 Importing from xls problems with the date format (mixed european format)
Hi.
I made some spreadsheets with Neo Office and saved them in xls format. So I can import them in numbers, doing so in OpenOffice, LibreOffice or even the worst in Mircosoft Office on a PC works just fine. But importing them with Numbers 2.0.4 it just don't work.
I have Mac OSX 10.5.8 and a PowerPC G4 1,67 GHz.
The date format in all other programs is " 21.05.2011" and numbers creates "21/05/2011" out of it. Although my international setting is set to 23.05.2012. It defines the cells as my own format and takes than the totally wrong format.
Does anyone know how to solve this problem, or how to change all the weird own formats in my international setting, which would be correct.
Best regards.Hi Franklin,
I used to have similar problem with date too. To make my forms and reports work for all date, I used to send the parameter from forms to the report in text format. In the report, I grab that parameter as "Text Format" (I mean the parameter created in Oracle Reports was really as Character in datatype property) then I manipulate them in my SQL to convert that "date" into real date using TO_DATE function. Usually I use DD-MM-YYYY as my date format.
Hope this help.
Regards,
Franko Lioe
Hello friends at www.oracle.com,
when I sent some informations to Reports, one of these informations was a date field. Here, the format mask may vary from one computer to another - some computers here are using american date format; however, my computer was using brazilian date format.
The fact is that I was sending date information to Reports using the mask dd/mm/yyyy, and Reports (in the computer that uses american date format) couldn't recognize it, stating that I was sending an invalid month. So I had to change my date information to dd-mon-yyyy and Reports could run in the other computer, but doesn't run here anymore - fact that obligated me to change my date format to american format.
Is there any way for me to use a date format mask that's valid to all computers here? If other computers - with other format masks - meet the same problem, the use of this program may become something very complicated.
Thanks for all answers,
Franklin Gongalves Jr.
[email protected] -
Plz. help with strange date insertions in access???
HELLO all,
i noted a strange thing, when i insert into access table the date it swaps the month and day part for some reason in some records .
why is this happening,
plz. help.
code is as follows
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH,-1);
System.out.println(""+cal.getTime());
//this swaps SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy")
//this swaps too
//SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
String currentdate = dateFormat.format(cal.getTime()); // formats your date
custom date is dd/mm/yyyy in tableHi vykalra1,
As far as I know, the way dates (and times) are stored in a Micro$oft Access database has nothing to do with the display format. The format is only used for displaying the date that is stored in the Access table.
A "field" with "Date/Time" datatype in an Access table maps to the "java.sql.Timestamp" class. Therefore, in order to insert a value into a "Date/Time" (Access) "field", you need to create a "java.sql.Timestamp" object. According to the javadoc, the "java.sql.Timestamp" constructor takes a parameter of type "long" (i.e. java primitive type) -- which represents the number of milliseconds since midnight, 1st January, 1970.
Therefore, you don't really need to use "Calendar" or "SimpleDateFormat".
As I understand it, you are trying to insert yesterday's date into your table. Below is an example using a sample table that has two fields -- 'name' and 'updated' -- which (hopefully) will help you. Note how I determine yesterday's date -- using millisecond calculations only.
The below code was compiled and tested on Windows XP with J2SE SDK 1.4.1_02 and Micro$oft Access 2002.
import java.sql.*;
public class JdbcOdbc {
public static void main(String[] args) {
Connection dbConn = null;
PreparedStatement stmt = null;
String sql = "INSERT INTO Table1 (name, updated) VALUES (?, ?)";
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
dbConn = DriverManager.getConnection("jdbc:odbc:db1");
stmt = dbConn.prepareStatement(sql);
stmt.setString(1,"vykalra1");
long now = System.currentTimeMillis();
long millisecondsInOneDay = 1000 * 60 * 60 * 24;
long yesterday = now - millisecondsInOneDay;
stmt.setTimestamp(2, new Timestamp(yesterday));
stmt.executeUpdate();
catch (SQLException sqlEx) {
System.err.println("Database operation failed.");
sqlEx.printStackTrace();
catch (ClassNotFoundException cnfEx) {
System.err.println("JDBC driver class not found");
cnfEx.printStackTrace();
finally {
if (stmt != null) {
try {
stmt.close();
catch (SQLException sqlEx) {
System.err.println("ERROR: Failed to close statement");
sqlEx.printStackTrace();
if (dbConn != null) {
try {
dbConn.close();
catch (SQLException sqlEx) {
System.err.println("ERROR: Failed to close DB connection");
sqlEx.printStackTrace();
}Good Luck,
Avi. -
Hi guys merry Christmas in advance .i was trying to write a code to compare given string with current date .
So i have written a piece of code to set hour minute second millisecond of current date to 0.
It worked fine for minute second millisecond but hour always shows 12.
Here is the code.
Please help
import java.util.*;
public class SampleDate
public static void main(String[] args)
java.util.Date date = new java.util.Date();
//convert current date to cal format and set hour min sec mill to 0
java.util.Calendar cal1=java.util.Calendar.getInstance();
cal1.setTime(date);
cal1.set(java.util.Calendar.HOUR,0);
cal1.set(java.util.Calendar.MINUTE, 0);
cal1.set(java.util.Calendar.SECOND, 0);
cal1.set(java.util.Calendar.MILLISECOND, 0);
//convert from cal to date format
date=cal1.getTime();
System.out.println("Current Date in Date Object: " + date);
}Output:
C:\TIMECOMPARE>java SampleDate
Current Date in Date Object: Thu Dec 24 12:00:00 IST 2009Expected output is :Current Date in Date Object: Thu Dec 24 00:00:00 IST 2009The HOUR field of the Calendar class represents a 12 hour clock format where 0 indicates 12 noon. Instead use the HOUR_OF_DAY in the code as shown below:
cal1.set(java.util.Calendar.HOUR_OF_DAY,0); -
Receiving error when calculating two fields with different date format
I am more familiar with SQL Server than Oracle, so after searching online without success, I am asking here.
I'm using PL/SQL Developer with Oracle DB 11g Enterprise Release 11.2.0.2.0 64 Bit
MyTable:
ID_Number VarChar2
Date_Received Date
Select ID_Number,
Date_Received,
To_Date(substr(ID_Number, 1,6), 'YYMMDD') SentDate,
Date_Received - To_Date(substr(ID_Number, 1,6), 'YYMMDD') NumDays
From MyTable
Where substr(ID_Number, 7,3) in ('ABC', 'ABD')
and Length(Trim(Translate((substr(ID_Number, 1,6)), '0123456789', ' ' ))) is null
ID_Number Date_Received SentDate NumDays
131002ABC1654106 10/16/2013 10/2/2013 14
131004ABD8813899 4/12/2013 4/8/2013 4
131014ABD1844832 10/16/2013 10/14/2013 2
Sometimes the first 6 characters in the ID_Number are not numbers, and the Length(Trim(Translate removes those records
I just want records where NumDays > 2
I've tried putting the query in a subquery and using Where NumDays > 2 outside. I've also tried using the computation directly in the Where clause. Without this in the Where clause it runs fine, with it in either spot I get the following error:
ORA-01931: Date format picture ends before converting entire input string
I'm not sure how to put both dates in the same format. I've tried declaring the format to no avail. I do not understand how I can calculate within the select but not use the same calculation within the Where clause.
Thank you for your help.Hi,
SQL is a language for describing the results you want. How the system gets those results is up to it; you don't have much say regarding which conditions will be applied when.
One place where you can control the order of things is in a CASE expression. When you say
CASE
WHEN condition_1
THEN expression_1
END
you can be sure that expression_1 will only be evaluated when cond_1 is TRUE.
Try something like this:
WITH got_sent_date AS
SELECT id_number, date_received
, CASE
WHEN TRANSLATE ( SUBSTR (id_number, 1, 6)
, 'x 0123456789'
, 'x'
) IS NULL
THEN TO_DATE ( SUBSTR (id_number, 1 6)
, 'YYMMDD'
END AS sent_date
FROM MyTable
WHERE SUBSTR (id_number, 7, 3) IN ('ABC', 'ABD')
SELECT id_number
, date_received
, sent_date
, date_received - sent_date AS num_days
FROM got_sent_date
WHERE date_received > sent_date + 2
If you'd care to post some sample data (CREATE TABLE and INSERT statements) and the results you want from that data, then I could test this.
Of course, you'll still have run-time errors if id_number starts with 6 digits, but they don't happen to be valid, e.g. '131100' or '130229'. That's one of the many reasons why storing date information in VARCHAR2 columns is such a bad idea. To get around that problem, see
https://forums.oracle.com/message/4255051 -
No English language setting with European date formatting available
The English language setting in my iPod bought in Finland forces date format to the American MM/DD/YYYY style. There is no English language setting that would result in the European DD.MM.YYYY or DD/MM/YYYY format.
Either making date formatting separately configurable (as time formatting already is), or adding another English locale with European-style date formatting solves this problem.Yes I agree, date format should be language independant. This is very annoying!
-
OA FRAMEWORK DATE FORMAT IS CONFLICTING WITH PERSONAL DATE FORMAT IN APPRAI
We are using Self service appraisals forms and added a field using oa framework personalizations. The field is available in the View Object and is mapped to an Attribute (DFF) field. The created item is of style Message Input Text with datatype DATE. This generates a small calendar icon right beside the field. On clicking the icon a calendar window pops up and a date can be selected. The date is inserted in the field in the format 23-Sep-2008. My personal preferences (equal to site preference) state that the date format should be DD-MON-YYYY. When I press continue in the appraisal form the date in the field is automatically changed in 2008/09/23. This obviously causes a validation error (screen popup). When I change my personal preference date format to YYYY/MM/DD everything works fine. However, we do not want to use date format YYYY/MM/DD. What setting determines the date format used for validating by OA Framework pages?
Thank you for your answer. First of all I am a functional consultant using basic personalization functionality to modify the layout of the standard forms and to enable the display of some of the descriptive flexfield attributes (you are correct) we activated on the competence elements entity. I encounter a problem with the dateformat and the fact that it is changing.. Can you be more precise in telling me where to look for format changes? Note that I do not have access to tools like JDeveloper and decided is that we cannot customize/add/substitute VOs.
CompetenciesCO and AssessmentsAM are the Controller and Application module involved using VO CompetenceElementsVO. (I try to insert a date value in Attribute2). -
Problem with the Date format and sending it to R/3
Hi all,
I have an Adaptive RFC application which fetches the data from the R/3 and displays the Employee's Personal Data.
I am using a ZFM which is customised as per the requirement from the Standard BAPI_EMPLOYEE_GETDATA.
Now the Problem i am facing is Date is default and Optional Parameter in RFC.
If i execute the RFC in R/3 without Date it is not filling the Internal Tables. And if i pass the Date it is filling the Internal Table and fetches the Records.
So in WD application i am inputing Employee FirstName, LastName or the Employee ID.
User can give any of the above input or combination of FirstName and LastName Or only the Employee ID.
Now the Main Problem is of Date which is of type Date.
I have also tried the SimpleDateFormat Class, but i am not able to achieve the result.
I have also seen the Links and threads on SDN, but unable to solve the problem.
So pls help me out asap.
Thanks & Regards,
Dhruv ShahHi ,
By default , RFC accept date format of SQL date (yyyy-mm-dd) . If you are using a date picker from WD, it directly set the date in SQL date format. Incase if you are trying to pass date to RFC in some other way you have to convert that into SQL date format before passing.
if you are passing String date of format dd-mm-yyyy , you try this method to convert that to SQL date and pass to your RFC.
public java.sql.Date sqlDateConvert( String date) {
//@@begin sqlDateConvert()
java.sql.Date dateObj=null;
try{
StringTokenizer tempStringTokenizer = new StringTokenizer(""+date,"-"); int dd=Integer.parseInt(tempStringTokenizer.nextToken().trim());
int mm=Integer.parseInt(tempStringTokenizer.nextToken().trim());
mm=mm-1;
int yyyy=Integer.parseInt(tempStringTokenizer.nextToken().trim());
Calendar cal =Calendar.getInstance();
cal.set(yyyy,mm,dd);
dateObj = new java.sql.Date( cal.getTime().getTime());
}catch(Exception e)
return dateObj;
Hope this will help you.
Maybe you are looking for
-
SPGridView - sorting Dates doesn't work properly & how to display the title column as link?
Hi, I've got a SPGridView that is being filled with data from several lists. Some of them are a date-field and a title-field. I already added sorting, paging and filtering options and at first look they seem to work fine. But now I noticed that sorti
-
How do I upgrade my software from 10.4.11 to 10.5.8 for my iPhone 4s
I have a new iPhone 4S but can't upload to iTunes, I've found it it's due to my software upgrade but don't know how to do this? How do I upgrade my software? I keep getting lost on Apple website. Help!
-
IEEE 1394 insufficient resources issue
We currently have a CVS-1454 with two cameras performing inspections. Due to circumstances with the inspection and machine, we are trying to move the inspections to the computer that is currently communicating with the CVS. We are getting the error
-
Nano doesn't appear in itunes "devices" screen
1. New nano 8G doesn't appear in itunes devices. 2. Connected ipod to comupter. Fives hours later nano screen shows "Connected" No other action. 3. How do I get up and running?
-
I just bought an apple tv two days ago and a new router today as mine was about 6 years old. My apple tv has no problem picking up the songs in my itunes, but takes forever to load movies from itunes. all the movies are digital copies as well. any re