Storing a Date/Time
I have a date/time field called SubmitDate. I'm trying to store the date/time into that field, just before saving the form. For some reason this JS is not working.
SubmitDate.rawValue = Date.getDate();
app.execMenuItem("SaveAs");
app.launchURL("http://Adobe.com");
Am I doing something wrong?
You haven't defined what Date is. I think you want o do somethig like this:
var nDate = new Date();
SubmitDate.rawValue = nDate.getDate();
After this code runs the value of the current day (an integer between 1-31) will be placed in the SubmitDate field. For today it woudl return 6.
Note that this is standard javascript and has nothing to do with the form. The only part that is unique to the form is the assignment statement to SubmitDate.
Paul
Similar Messages
-
Single text and date/time line still stays?
i think ios 8 update did this
with IOS 7 you were able to delete a single text message within a message string and the date and time stamp of the message string was reset back to the last message in the string. In IOS 8 even if you delete a single text message is still tracks the date/time when the last message was received/sent even after it's been deleted. I don't want to delete the whole string just a single text message and have it look like it never appeared. But with it still storing the date/time stamp it's sorted in messages like something was there. Anyone know if I can fix this??i think ios 8 update did this
with IOS 7 you were able to delete a single text message within a message string and the date and time stamp of the message string was reset back to the last message in the string. In IOS 8 even if you delete a single text message is still tracks the date/time when the last message was received/sent even after it's been deleted. I don't want to delete the whole string just a single text message and have it look like it never appeared. But with it still storing the date/time stamp it's sorted in messages like something was there. Anyone know if I can fix this?? -
Date/Time Format Stored Procedure Calls in ADVANCE MODE in JDBC ADAPTER
Hi Experts,
What is significance of Date/Time Format Stored Procedure Calls in ADVANCE MODE in JDBC ADAPTER.
Thanks,
ABDURI guess this would be applicable for the folowing formats - DATE, TIME, TIMESTAMP.
This is the correct link
http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
Regards,
Prateek -
Problem in storing date & Time value
How to store the Date & time value in 1 textfield only.In my case i am selectecting The Time from two LOV's (HH & MM),then Date value is selecting from simple i/ptext,
I want to store the (Date+HH+MM) in the date field.......
code is....
public String CalculationM() {
BindingContainer bindings = getBindings();
DCIteratorBinding dcIterBinding = (DCIteratorBinding)bindings.get("Timeview1Iterator");
RowSetIterator row= dcIterBinding.getLovRowSetIterator();
String i=selectOneChoice5.getValue().toString();
int index=Integer.parseInt(i);
int index2=index+1;
Row r= row.getRowAtRangeIndex(index2);
String val=r.getAttribute("Hour").toString();
String i1=selectOneChoice6.getValue().toString();
// System.out.println("HH index="+index2+" MM index is="+i1);
int index1=Integer.parseInt(i1);
int index3=index1+1;
Row r1=row.getRowAtRangeIndex(index3);
String val1=r1.getAttribute("Minutes").toString();
int valint=Integer.parseInt(val);
String valnew;
if(valint<=12)
{ if(valint==12)
valnew=val+":"+val1+":"+"PM";
else
valnew=val+":"+val1+":"+"AM";
else
val=String.valueOf((valint-12));
valnew=val+":"+val1+":"+"PM";
valnew=val+val1;
String Dateis= inputText4.getValue().toString();
String Date1=Dateis+" "+valnew;
System.out.println("TOTAl Date Is="+Date1);
try
{ SimpleDateFormat sdf = new SimpleDateFormat("dd:MM:yyyy hh:mm");
java.util.Date date = sdf.parse(Date1);
java.sql.Date sqlDate = new java.sql.Date(date.getTime());
oracle.jbo.domain.Date ojdd = new oracle.jbo.domain.Date(sqlDate);
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
DCBindingContainer binding = (DCBindingContainer) app.getVariableResolver().resolveVariable(context, "bindings");
binding.findIteratorBinding("AppointDetView1Iterator").getCurrentRow().setAttribute(7,ojdd);
catch(ParseException e)
System.out.println("Error is:"+e.toString());
OperationBinding operationBinding =bindings.getOperationBinding("Commit");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
return null;
But i am getting error ....the Time is not storing in Date field bt the Time which we r giving with the Date field is storing.......
My Date Attribute has Date format as dd-MM-yyyy hh:mm:aa
If i changed it to dd-MM-yyyy then .... The value "12-3-2008" is not a valid date. Valid example: "29-11-2005 ".this error is getting
Error
- Not a date.
Plz help me in this case ...wil be very thankful for ur help.........actually i am inputting the value 12-03-2008 but i am getting tha error which i hav told before....
plz reply me....
Message was edited by:
user553181 -
Date / Time stored as Number(22,0) question
I've been working with a database (i'm not the author) who's date/time stamp is stored as a number(22,0) within the database.
I need pull out the date and convert. It appears to be an 18 character number. Is there a method, stored procedures, function, etc. that will conver this to a date that I'm overlooking?
Example:
129744082444876330
thanks,
Bobrconnellii wrote:
I've been working with a database (i'm not the author) who's date/time stamp is stored as a number(22,0) within the database.
I need pull out the date and convert. It appears to be an 18 character number. Is there a method, stored procedures, function, etc. that will conver this to a date that I'm overlooking? Sounds like Unix time. Easily handled using a (deterministic) user defined PL/SQL function, or native SQL (if performance is of concern). -
Stored Procedure using Date/Time Comparison
I’m running SQL Server 2012. I need to write a procedure that will send out emails based on a date/time comparison.
In my table, ‘tickets’, I have a smalldatetime column ‘ticket_date’ and another column ‘responded’ which is a bit field. I need to check the current date to see if 24 hours has passed from the ticket_date. If 24 hours has passed and responded is 0, then
I need to email a manager ( I already have the code for emailing with SMTP).
The next step is to see if 48 hours has passed from the ticket_date and if responded is 0.
If this is true, then I need to email someone else.
I don’t want to include weekends in my time comparison. My procedure will only run Mon – Fri.
Thanks in advance!Check the below sample and hope this will help you:
DECLARE @Tickets TABLE (TicketID INT, TicketDate SMALLDATETIME, Responded BIT)
INSERT INTO @Tickets
SELECT 1, '01/10/2015 10:00AM', 0 UNION ALL
SELECT 2, '01/13/2015 12:00PM', 1 UNION ALL
SELECT 3, '01/12/2015 05:30PM', 0 UNION ALL
SELECT 4, '01/09/2015 08:00AM', 1
SELECT *, '24 Hour' AS TicketCase
FROM
@Tickets
WHERE
Responded = 0
AND DATEDIFF(HOUR, TicketDate, CURRENT_TIMESTAMP) <= (CASE DATEPART(WEEKDAY, TicketDate) WHEN 7 THEN 48 WHEN 1 THEN 24 ELSE 0 END) + 24
UNION ALL
SELECT *, '48 Hour' AS TicketCase
FROM
@Tickets
WHERE
Responded = 0
AND DATEDIFF(HOUR, TicketDate, CURRENT_TIMESTAMP) >= 24
AND DATEDIFF(HOUR, TicketDate, CURRENT_TIMESTAMP) <= (CASE DATEPART(WEEKDAY, TicketDate) WHEN 7 THEN 48 WHEN 1 THEN 24 ELSE 0 END) + 48
Output
TicketID | TicketDate | Responded | TicketCase
3 | 2015-01-12 17:30:00 | 0 | 24 Hour
1 | 2015-01-10 10:00:00 | 0 | 48 Hour
You can make the separate SQL statements and email to proper people based on 24 hour or 48 hour case.
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered. -
Date / Time System fields - inconsistent
This is a weird one...please bear with me
Before I begin...note that this is not a problem that is difficult to fix, I'm just interested in better understanding why the system fields are behaving the way they are.
We have 20 or so programs that use a function module to create a file header that includes a date/time stamp. The programs also place a trailer with a date/time stamp that should match the one in the header. However, the programmer used different system fields (after a GET TIME statement) to create the date/time stamp in the trailer. On occasion, the date/time stamp comes out different.
Here's the code (sry about all caps):
GET TIME.
CONCATENATE SY-DATUM SY-UZEIT INTO BATCHID.
CALL FUNCTION 'Z_YADAYADA'
EXPORTING
FILE_ID = P_FILEID
REFRESH_TYPE = P_REFTYP
START_PERIOD = START_PER
END_PERIOD = END_PER
IMPORTING
STRING255 = OUTPUTSTRING
EXCEPTIONS
INVALID_REFRESH_TYPE = 1
INVALID_BATCH_ID = 2.
...sy-subrc check...
TRANSFER OUTPUTSTRING TO P_FILE1. <--header output
CONCATENATE L_TRL BATCHID COUNT T_TOTAL SPACE
INTO OUTPUTSTRING SEPARATED BY L_DEL.
CONDENSE OUTPUTSTRING NO-GAPS.
TRANSFER OUTPUTSTRING TO P_FILE1. <--trailer output
inside function module *****
CONCATENATE: SY-DATLO SY-TIMLO INTO DATESTAMP,
SY-SYSID SY-MANDT INTO MACHINE_NAME.
CONDENSE: DATESTAMP, MACHINE_NAME NO-GAPS.
CONCATENATE C_HDR DATESTAMP FILE_ID MACHINE_NAME
SY-CPROG ' ' REFRESH_TYPE START_PERIOD
END_PERIOD DATESTAMP
INTO STRING255 SEPARATED BY '~'.
CONDENSE: STRING255 NO-GAPS.
You can see that the function uses SY-DATLO and SY-TIMLO for creation of the header, while SY-DATUM and SY-UZEIT are used for the trailer. What's wierd is that sometimes the trailer has a date/time stamp that is 1 second <b>greater</b> than the header, despite the fact that it is stored in the BATCHID variable <b>before</b> the header is created.
Any help, references, explanations greatly appreciated (and rewarded with points)
BMVHi Brian
Here is the related part from the weblog of ABAP expert Horst Keller. Hope it may help. For the full document, you can visit <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.wcm.compound.docs/library/uuid/f1391fc3-0301-0010-d384-fccd036f1c67">here</a>.
The values of all system fields in this table are implicitly set when the program is started, every time a screen layout of a screen is sent, and when the internal mode is set. The GET TIME command explicitly updates the system fields, except for sy-dayst, sy-fdayw and sy-tzone.
With the exception of sy-datlo and sy-timlo, all system fields refer to the local date and time of the current SAP system. The ABAP runtime environment clock is synchronized with the database server clock at regular intervals in order to calculate the local time of the SAP system. During the synchronization process, the ABAP runtime environment clock is set to the database server clock. Because this happens on all application servers in an SAP system, the ABAP runtime environment clock is synchronous with the clocks on all other application servers and with the database system clock, and thus shows the local time of the entire SAP system. The time zone on which the local time of an SAP system is based is the only entry in the database table TTZCU.
The content of sy-zonlo is taken from the user master record of the current user. The values of sy-datlo and sy-timlo are calculated from sy-datum and sy-uzeit and from the time zone of the SAP system for the time zone in sy-zonlo. If the user master record does not contain a time zone, or if it contains an invalid or an inactive time zone, sy-datlo and sy-timlo are set to the values of sy-datum and sy-uzeit. All valid time zones are defined in table TTZZ.
Is't the naming of sy-datum and sy-uzeit really geeky?
Time Stamps
The above system fields for date and time are not sufficient for many requirements of determining unique points in time: They represent local times and the values are measured in seconds. For more exact date and time determination, you use time stamps.
A time stamp represents date and time in the form YYYYMMDDHHMMSS. YYYY is the year, MM the month, DD the day, HH the hour, MM the minutes and SS the seconds. There is a short form and a long form. In the long form, the format specified above additionally contains 7 decimal places for fractions of seconds, which allows for an accuracy of up to 100 ns. The maximum time resolution depends on the operating system of the application server and may be less.
A valid time stamp must contain values whose date and time specifications before the decimal separator correspond to valid values for the data types d and t. Time stamps in this form are always considered as UTC (Universal Time Coordinated, basis for calculating worldwide time specifications; the UTC reference time is based on Greenwich Mean Time, GMT, but is not a time zone; it has no daylight saving time or summer time) time stamps when processed with the corresponding statements. You use the statement GET TIME STAMP to create a time stamp that represents the current UTC reference time.
Regards
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a> -
Batch edit date & time in PSE 8 Mac/Bridge
OK, maybe it's jet lag. I uploaded all my vacation photos, and realized I had forgotten to adjust camera date/timezone. I remember that earlier versions of PSE Windows had the ability to batch adjust the date/time shot, but I can't find it in Bridge CS4 or PSE 8 Mac. I really don't want to do it manually for a few hundred photos. Is the capability hiding in there somewhere? thx
Thanks, Barbara. One of the utilities you mentioned -- PhotoInfo -- does have a very easy batch mode for date/time change. And, of course, so does iPhoto.
Unfortunately, they both run afoul of another detail: there are multiple date/time stamps stored in a JPG. iPhoto and PhotoInfo both read/write the CreateDate XMP metadata field, but Bridge and PSE appear to base "Date Created" on the value stored in the DateTimeOriginal EXIF field. I haven't tried GraphicConverter yet, nor EXIFtool, which definitely handles all timestamps but is command-line only. I have some tools on the Windows side that I'll try first.
rgds -
Date/ TIme in user profile settings
Hi Abappers,
The date/time format changed in transaction SU01->own data-> defaults, is captured in which table fields???Hi,
The date and time format values of a user are stored in USR01 table.
Date format field - USR01-DATFM (Date format)
Time format field - USR01-DCPFM (Decimal notation)
Look the possible values by pressing F4 on the DATFM field.
Thanks,
Vinay -
How to insert a data&time to Database date field
Dear Friends,
I have created a Stored Procedure which takes a Date data type as an input,When i call this procedure from java i need to set the data&time in
yyyymmddhhmmss format. How to set this from java ?.
Rgds
Mohan SHow to set this from java ?.Usually you use a prepared statement and one of the set methods.
Or you can use setString() and format the date yourself using SimpleDateFormat. -
Date & Time - Set Automatically Not Working
I'm experiencing some very quirky behviour with the time that appears on status bar on the home screen and the world clocks.
Ever since the DST change on the weekend my iPhone no longer acquires the correct time from the network when I have "set automatically" enabled for Date & Time. Prior to this I have traveled through various time zones and the correct time would always be displayed. Even on the World Clocks.
Now the iPhone acquires time that is -1hr. However, all the World Clocks appear correct (even for the local city that I'm in).
If I disable "set automatically" and select the city I'm in everything returns to normal and the World Clocks continue to function.
Since I travel a lot it really bothers me that the set automatically doesn't work and I would really like a long term solution so I can keep it enabled.
In the meantime, can anyone help explain the following:
1. How is time stored on the iPhone? Is it set to local time or GMT with a timezone offset?
2. How does it acquire time and timezone from the carrier?
3. How does it determine the time to display on the status bar and screen saver?
4. How does it determine the time to display for the World Clocks?
I am running firmware 1.1.4I am currently in Winnipeg, Manitoba. Current timezone is UTC/GMT -5 (CDT - Central Daylight Time).
When date & time is set to automatic, the time in the status bar is incorrect for Winnipeg by -1 hr. All the times in the World Clock are correct (including the display for Winnipeg).
I recall an issue I had when using Bootcamp on my Macbook. The Macbook records system time (and all time stamps) in UTC/GMT but displays the correct time once you specify the timezone offset. This caused problems when booting back and forth with Windows because Windows assumed the system clock was set to the local time (I now use VMWare Fusion). This issue was well documented on the Apple site.
I'm assuming the iPhone behaves similar to my Macbook and Mac OS and expects the system time to be set as UTC/GMT. The behaviour I'm experiencing suggests the UTC/GMT time is actually being set correctly on the iPhone (otherwise, the world clocks wouldn't display the correct time) but the timezone offset is incorrect for Winnipeg (which determines how it's displayed in the status bar).
I did some significant troubleshooting last night and gathered some data to further explain the problem. However, I fear that if I post it publicly the thread may be deleted. -
Type of object from a database date/time column
Hello everyone,
I've got a concern regarding the way in which coldfusion is
treating date/time columns in a database.
In my opinion when I select a column that is let's say
timestamp type - the object in a query is CF's date/time object.
I've checked the query by getMetaData() and it looks like each
column has its own database type (eq. varchar2, date, etc).
My concern comes from a fact that I've heard that Coldfusion
is treating the date-time columns in a database as strings and in
each case it parses them. So the difference in a locale between a
database server and a Coldfusion server may result in a wrong
date/time object.
Example:
Locale of database EU: yyyy/mm/dd
Locale of Coldfusion US: yyyy/dd/mm
The date like 1st of February 2007 stored in a database would
look then in Coldfusion like: 2nd of January 2007
Could someone please confirm which version is valid?Johnny852 wrote:
> In my opinion when I select a column that is let's say
timestamp type - the
> object in a query is CF's date/time object. I've checked
the query by
> getMetaData() and it looks like each column has its own
database type (eq.
> varchar2, date, etc).
if you already know cf is returning a datetime from a
datetime in the db, what's
the question?
> My concern comes from a fact that I've heard that
Coldfusion is treating the
"fact"? unless the datetime is stored as a string, that's not
a "fact".
> Example:
> Locale of database EU: yyyy/mm/dd
> Locale of Coldfusion US: yyyy/dd/mm
btw neither of your example "locales" are in fact locales.
> The date like 1st of February 2007 stored in a database
would look then in
> Coldfusion like: 2nd of January 2007
if you pass a numeric string representation (2/1/2007 for
instance) of a date to
cf, it will be interpreted via the cf server's "default"
local (ie en_US,
month/day/year) unless you use one of the LS functions like
LSParseDateTime() &
specifically set the the locale (like setLocale("th_TH")) or
make the date
non-ambiguous (2-feb-2007) or build the date yourself from
user input using
createDate() or createDateTime(). you just need to convert
the user's string
representation to a valid cf datetime object (or i guess
force to database to
follow the user's locale date mask). -
CMC not converting parameter correctly YYYYMM to Real Date Time
I have a paramater in a report that is a string because the value is stored in the database as a string: YYYYMM.
I need to convert this string parameter into a real date time (Assuming the last day of the month)
I've tried this a number of ways which work fine in my desktop Crystal client but CMC changes the values.
For Year I'm using this function:
numbervar DateInput;
numbervar DtYear;
DateInput:= {?p_RevYRMOEndRange};
DtYear:= ToNumber (mid(ToText (DateInput),1,4));
DtYear;
which returns 2010 for example on the desktop, and 201 in infoview/CMC
For the Month my function is:
numbervar DateInput;
stringvar DtMo;
numbervar DtMoNum;
DateInput:= {?p_RevYRMOEndRange};
DtMo:= (Right(ToText (DateInput),2));
DtMoNum:= ToNumber (DtMo);
DtMoNum;
which returns 2 on my desktop and 0 in CMC.
Any ideas on a different way I could do this which might be more reliable in CMC?
Thanks,
Johnnumbervar DateInput;
numbervar DtYear;
DateInput:= {?p_RevYRMOEndRange};
DtYear:= ToNumber (mid(ToText (DateInput),1,4));
DtYear;
2010 and 201 looks like there is a leading space
try to print
numbervar DateInput;
DateInput:= ">"+{?p_RevYRMOEndRange}+"<";
and then look at trim options
Edited by: AlunJD on Jun 23, 2011 2:32 PM -
SQL query for date & time interval
Hello everyone,
there is my problem
I have to make a search for events that are taking place during inserted date & time .
There's the table structure:
event
datefrom
dateto
timefrom
timeto
The problem is, when I try:
select * from xyz where datefrom <= inserted_date and dateto >= inserted_date and timefrom <= inserted_time and timeto >= inserted time;
then I don't get back all records.
eg: user inserts date = 10.10.2010 and time 10:00 and in the table is event [abc 11:00 9.10.2010 -> 09:00 11.10.2010] stored following way:
event abdc
datefrom 09.10.2010
dateto 11.10.2010
timefrom 11:00
timeto 09:00
=> this event won't be found, because the sql logic compares only single parameters and not their context.
Do you have any idea, how to solve this issue?
Thank you.
LukasHello Hubert,
thank you very much for your proposal, but your code makes the same select as mine (but in a more user friendly look :).
Table:
datefrom 09.10.2010
dateto 11.10.2010
timefrom 11:00
timeto 09:00
Event date = 10.10.2010 and time 10:00.
Your query:
select * from xyz where 10.10.2010 between 09.10.2010 and 11.10.2010 (that's so far ok) and 10:00 between 11:00 and 9:00 (no return there, because 10:00 doesn't lie within interval 11:00 -> 9:00... actually no value lies there) ;
Don't you have any other idea?
Thank you
Lukas -
Inserting logon date & time into a table
hi,
i want to insert the logon date&time into a table which have a field
called log_track and data type as date. i want to insert the
information as 'dd/mm/yyyy hh24:mi:ss' . I tried to insert with
the follwoing
insert into log_chek values ( to_date(sysdate,'dd/mm/yyyy hh24:mi:ss))
but it is not taking the time...how to include the time also..? I am using oracle 8i
thanks in adv
krisDates are stored as dates. You cannot select to store a date in date format like dd/mm/yyyy hh24:mi:ss. That is not your decision to make. It is stored as a date format as a binary value.
How you want to view that date, is your decision. How must this binary date format value much be displayed as a text string?
So, when inserting a date you insert it as a date. That simple.
insert into log_chek values ( sysdate )
When you want to view that date, you decide how you would like it to be displayed in human readable format:
select TO_CHAR( log_date, 'dd/mm/yyyy hh24:mi:ss') as log_date from log_chek
Maybe you are looking for
-
Major problems with iPhone 4 & iPad 2 both 5.1.1. - Outlook Calendar sync
Folks, really need some help here, being forced to revert to Blackberry Bold 9000 because of issues with Outlook Calendar sync since 5.1.1 upgrade on both my iPhone & iPad. Our company Enterprise Active Sync server is 2003 (please don't mention upgr
-
SCCM 2012 Multiple Domains with a single SCCM instance
Hello: Can SCCM 2012 be deployed to multiple untrusted domains within a single install? I work for a company that maintains multiple client networks all Windows Domain and non are trusted / or are even aware of the other sites. I would like to setup
-
I updated iTunes and now it won't back up my iPhone, what can I do?
I updated my iTunes today. When I plug in my iPhone, it won't update or back up. Is there something I can do about this?
-
Upgrade from 9.2.0.7 to 9.2.0.8
Can any one give suggestions on this ... How to upgrade? Should I use DBUA or etc.....
-
Hello, I am new to BW and appreciate some help. Thank You in advance. I have a flat file with a date field in the format MMYYYY. The infosource has 0CALMONTH field. When I preview the data befor upload creates error on the record with single digit