Calculating Time

Hi
Is it any function to get the time difference ??
I have a table timesheets which has from_time and to_time to store the time .I am using Varchar2(5) ,with the format of 99.99 to store the timesheet times.
if I want to get the time difference between from_time and to_time how to do that ?? is there any function to do that ??
For Example
From_time to_time
12.15 13.00
if you do difference calculation it will give .85 ,which is wrong , I am expecting .45 asif it's time. how to do that ?? Can anybody help me .
Thanks
S.j.k

You are expecting .45? .45 of what? Certainly not an hour - that would be 27 minutes.
I would certainly recommend storing these values in a date datatype, not a varchar2, but...assuming your times do not cross days, you can get the difference in minutes by converting the times to dates:
sql>select (to_date('13.00', 'hh24.mi') - to_date('12.15', 'hh24.mi')) * 1440 diff_minutes
  2    from dual;
DIFF_MINUTES
          45

Similar Messages

  • Problem at calculation time, when using Dynamic Calc measures

    Hello,<BR><BR>We are using Essabse v6.5 and we want to upgrade to v7.1.<BR>we are performing some tests, in order to check that the Cubes we have created in 6.5 are working properly in v7.1.<BR><BR>the problem that we are experiencing is that the calculation time for the cubes that have dynamic calc members has exploaded to 10 times more, compared to what it took at version 6.5.<BR><BR>Do you have any idea why this happens. (also we are still using the old client "Application Manager")<BR><BR>Furhermore, I have set up 2 cubes that are the same, except the 1st has dynamic calc memebers, whereas the 2ns has not.<BR>I perform calcualtions with the “SET MSG DETAIL;” and receive the following:<BR>CUBE (A) with Dynamic Calc<BR>Total Block Created: [4.3720e+03] Blocks <BR>Sparse Calculations: [8.0620e+03] Writes and [2.5338e+05] Reads <BR>Dense Calculations: [2.8000e+01] Writes and [2.8000e+01] Reads <BR>Sparse Calculations: [6.0202e+06] Cells <BR>Dense Calculations: [1.1476e+06] Cells <BR><BR>CUBE (B) withOUT Dynamic Calc<BR>Total Block Created: [4.3720e+03] Blocks <BR>Sparse Calculations: [4.3720e+03] Writes and [3.5887e+04] Reads <BR>Dense Calculations: [2.8000e+01] Writes and [2.8000e+01] Reads <BR>Sparse Calculations: [6.0202e+06] Cells <BR>Dense Calculations: [1.1476e+06] Cells <BR><BR>Question: Why does Cube (A) has more “Sparse Calculations” than Cube(B) ????<BR><BR><BR>thanx

    Yes, all the settings were exactly the same. See following:<BR>- Data Cache (note: we are NOT using the Data File Cache) <BR>- Index Cache<BR>- Index Page<BR>- Commit Block Interval<BR>- Cache memory Locking<BR>- Access Mode = buffered IO<BR>- Data Compression = Bit-Map encoding<BR>- Two Pass Calculatino = ON<BR>- Aggregate Missing Values = ON<BR>- CFG file<BR><BR><BR>Is there any new settings in 7.1 that I must configure?<BR>Is there any settings that I cannot see through the old client Application Manager, which is important? Must I install the new client in order to be able to configure correctly the Outline/Cube?<BR><BR>Thnkx<BR><BR>

  • I have been trying to update via App Store and every time only with apple software it starts to download and it will says it's calculating time remaining then an error message pops up saying " An error has occurred the request timed out. (102) "

    I have been trying to update via App Store and every time only with apple software it starts to download and it will says it's calculating time remaining then an error message pops up saying " An error has occurred the request timed out. (102)" I have tried everything , I've been told its my ISP but I have tried using differenet internet to attempt the updates. Like I said all other software updates fine its just apple software

    http://www.apple.com/support/mac/app-store/contact.html?form=account

  • Having trouble calculating time

    i need help calculating times in Adobe Designer. I am creating a simple form for keeping track of hours worked. i am using a simple calculation subtracting one field from another to get hours worked from 2 times entered but the calculation doesn't work when :30 or :15 are entered. i am giving each field its own name and i am using h:MM A as a display. sorry for my simplicity - the scripts are really difficult for me. any help is appreciated - i am tearing my hair out:)

    Hi,
    First of all is it possible to add times?
    What you can do is to use another format. Decimals instad. Then the user can fill in 0.5 for :30 and 0.25 for :15
    A workaround solution.
    Regards, Sandhya

  • I have been using time machine to back up my Mac Book Pro 3.1 to my Time Capsule. Now the Time machine hangs up on "calculating time remaining".

    I have been using time machine to back up my Mac Book Pro 3.1 to my Time Capsule. Now the Time machine hangs up on "calculating time remaining".
    Mac Book Pro - 3.1-15-inch  2.4/2.2GHz), Processor 2.2 GHz Intel Core 2 Duo
    Operating system : OS X 10.10.1
    Time Machine Version 1.3, Copyright 2007-2014 Apple Inc., Modified Tuesday, September 9, 2014 at 6:03 PM
    Time Capsule: 500 GB C 2007
    This Time Machine software worked satisfactory until Monday Nov, 10 2014 and I have backups until that time. For several years, the software deleted the oldest back up to save the latest one. This is acceptable to me as I have off site storage that is updated every 3 months. How do I get Time machine working again?

    I have spent a couple of days trying to respond to Linc Davis. Finally I figured it out . The following is a copy of data from my console from the initiation of a time machine backup until it gets stuck trying to calculate the time remaining. There is no indication that anything starts saving.  I copied about 3 minutes of data. This is probably way too much data, but I do not know what is relevant.
    Thanks for the help,
    calcool
    12/22/14 3:16:54.655 PM com.apple.backupd[551]: Starting manual backup
    12/22/14 3:16:55.057 PM com.apple.backupd[551]: Attempting to mount network destination URL: afp://”name”%20”lastname”@Home%20Network%20Time%20Capsule._afpovertcp._tcp.loca l./Time%20Capsule
    12/22/14 3:16:57.262 PM mds[33]: (Volume.Normal:2464) volume:0x7fed5ab54000 ********** Bootstrapped Creating a default store:0 SpotLoc:(null) SpotVerLoc:(null) occlude:0 /Volumes/Time Capsule
    12/22/14 3:16:57.565 PM com.apple.backupd[551]: Mounted network destination at mount point: /Volumes/Time Capsule using URL: afp://”name”%20”lastname”@Home%20Network%20Time%20Capsule._afpovertcp._tcp.loca l./Time%20Capsule
    12/22/14 3:17:08.000 PM kernel[0]: hfs: mounted Backup of “name” “lastname”’s MacBook Pro on device disk3s2
    12/22/14 3:17:09.625 PM com.apple.backupd[551]: Disk image /Volumes/Time Capsule/”name” “lastname”’s MacBook Pro (2).sparsebundle mounted at: /Volumes/Backup of “name” “lastname”’s MacBook Pro
    12/22/14 3:17:11.112 PM com.apple.backupd[551]: Backing up to /dev/disk3s2: /Volumes/Backup of “name” “lastname”’s MacBook Pro/Backups.backupdb
    12/22/14 3:17:24.931 PM “name”[593]: audit warning: soft /var/audit
    12/22/14 3:17:24.944 PM “name”[594]: audit warning: allsoft
    12/22/14 3:17:24.958 PM “name”[596]: audit warning: closefile /var/audit/20141222201654.20141222201724
    12/22/14 3:17:26.544 PM com.apple.backupd[551]: Event store UUIDs don't match for volume: Macintosh HD
    12/22/14 3:17:34.767 PM com.apple.backupd[551]: Deep event scan at path:/ reason:must scan subdirs|new event db|
    12/22/14 3:17:34.768 PM com.apple.backupd[551]: Reading cached event database from: /Volumes/Backup of “name” “lastname”’s MacBook Pro/Backups.backupdb/”name” “lastname”’s MacBook Pro (2)/2014-12-22-151726.inProgress/F85FEA51-E137-471A-84DA-A2C00E4ECB42/.1BEF88C6 -20C3-3DDC-AE30-05EAB2AFCC15.eventdb
    12/22/14 3:17:38.115 PM com.apple.backupd[551]: Using cached disk scan
    12/22/14 3:17:39.114 PM com.apple.backupd[551]: Saved event cache at /Volumes/Backup of “name” “lastname”’s MacBook Pro/Backups.backupdb/”name” “lastname”’s MacBook Pro (2)/2014-12-22-151726.inProgress/5BC46A53-25E8-4C4A-8947-AFB221D1FA0C/.1BEF88C6 -20C3-3DDC-AE30-05EAB2AFCC15.eventdb
    12/22/14 3:17:39.355 PM com.apple.backupd[551]: Not using file event preflight for Macintosh HD
    12/22/14 3:19:14.782 PM CoreServicesUIAgent[294]: unexpected message <OS_xpc_error: <error: 0x7fff77befc60> { count = 1, contents =
                "XPCErrorDescription" => <string: 0x7fff77beff70> { length = 18, contents = "Connection invalid" }
    }>
    12/22/14 3:20:15.207 PM locationd[182]: Location icon should now be in state 'Active'
    12/22/14 3:20:17.267 PM locationd[182]: Location icon should now be in state 'Inactive'
    12/22/14 3:20:17.884 PM locationd[182]: Location icon should now be in state 'Active'
    12/22/14 3:20:18.483 PM sandboxd[296]: ([310]) com.apple.metada(310) deny mach-lookup com.apple.cfnetwork.cfnetworkagent
    12/22/14 3:20:21.646 PM com.apple.metadata.SpotlightNetHelper[310]: [SLSUGGESTIONS] Location managed failed with error Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"
    12/22/14 3:20:23.892 PM WindowServer[143]: disable_update_timeout: UI updates were forcibly disabled by application "Spotlight" for over 1.00 seconds. Server has re-enabled them.
    12/22/14 3:20:26.526 PM WindowServer[143]: common_reenable_update: UI updates were finally reenabled by application "Spotlight" after 3.63 seconds (server forcibly re-enabled them after 1.00 seconds)
    12/22/14 3:20:28.298 PM sandboxd[296]: ([310]) com.apple.metada(310) deny mach-lookup com.apple.cfnetwork.cfnetworkagent
    12/22/14 3:20:29.094 PM com.apple.xpc.launchd[1]: (com.apple.quicklook[599]) Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.quicklook
    12/22/14 3:20:30.670 PM bird[263]: Assertion failed: ![_xpcClients containsObject:client]
    12/22/14 3:20:30.670 PM bird[263]: Assertion failed: ![_xpcClients containsObject:client]
    12/22/14 3:20:32.294 PM com.apple.InputMethodKit.UserDictionary[600]: -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](808): CoreData: Ubiquity:  “name”~00000000-0000-1000-8000-001B63947FCF:UserDictionary
    Using local storage: 1
    12/22/14 3:20:32.317 PM bird[263]: Assertion failed: ![_xpcClients containsObject:client]
    12/22/14 3:20:32.769 PM locationd[182]: Location icon should now be in state 'Inactive'
    12/22/14 3:20:34.580 PM Console[601]: Failed to connect (_consoleX) outlet from (NSApplication) to (ConsoleX): missing setter or instance variable
    12/22/14 3:20:35.540 PM com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.
    12/22/14 3:20:36.388 PM com.apple.xpc.launchd[1]: (com.apple.auditd[604]) Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.auditd
    12/22/14 3:20:36.693 PM “name”[608]: audit warning: soft /var/audit
    12/22/14 3:20:36.718 PM “name”[607]: audit warning: allsoft
    12/22/14 3:20:37.045 PM “name”[610]: audit warning: closefile /var/audit/20141222201724.20141222202036
    12/22/14 3:20:37.438 PM bird[263]: Assertion failed: ![_xpcClients containsObject:client]
    12/22/14 3:20:42.437 PM QuickLookSatellite[611]: CGSConnectionByID: 0 is not a valid connection ID.
    12/22/14 3:20:42.437 PM QuickLookSatellite[611]: Invalid Connection ID 0
    12/22/14 3:20:42.477 PM QuickLookSatellite[611]: CGSConnectionByID: 0 is not a valid connection ID.
    12/22/14 3:20:42.477 PM QuickLookSatellite[611]: CGSConnectionByID: 0 is not a valid connection ID.
    12/22/14 3:20:42.612 PM QuickLookSatellite[611]: [QL] No sandbox token for request <QLThumbnailRequest stackshot.log>, it will probably fail
    12/22/14 3:20:42.613 PM QuickLookSatellite[611]: [QL] No sandbox token for thumbnail request file:///Library/Logs/stackshot.log, it will probably fail
    12/22/14 3:20:42.615 PM QuickLookSatellite[611]: [QL] No sandbox token for request <QLThumbnailRequest stackshot-syms.log>, it will probably fail
    12/22/14 3:20:42.615 PM QuickLookSatellite[611]: [QL] No sandbox token for thumbnail request file:///Library/Logs/stackshot-syms.log, it will probably fail

  • Calculated time of predecessor and successor task

    Hi
    In standard system calculated time of predecessor and successor task are not strictly continued. For example, Task1 under Phase One is a predecessor task of Task3 which is under Phase Three, and Phase Two is between Phase One and Three. The earliest finish time of Task1 is 8.31, but the successor task Task3 does not begins on 9.1(maybe it's earliest start time is 10.1 e.g). That is because the system takes the duration of Phase Two into account. How to break this time structure and let Task3 starts strictly following Task1(here the earliest start date is 9.1). Is there any configuration or BAPI we can use here?
    Regards,
    Yemi

    Hi Yemi,
    This is the standard behavior in PPM system since PPM is mainly used for projects where stage-gate methodology is followed.
    To overcome this and allow parallel phase scheduling, you need to implement BADI - DPR_SCHEDULING. Refer below thread, where it is discussed in detail.
    http://scn.sap.com/thread/3282028
    Regards,
    Ravi

  • Error during date calculation: Time entered not numerical

    Hi All,
    We are using SAP MI 7.0 SP18 Server and Client
    xMAM 3.0 SR06
    Now when we create a Notification using the link  Notification Management of type PV and SAVE.
    When Synchronized, it is completed but backend no notification is trigerring and when checked in Error Logs
    the following message is shown Error during date calculation: Time entered not numerical
    Kindly Suggest
    Regards,
    Kiran Joshua

    Hi All,
    I got to know how to edit the entries from merep_mon : Thanks to Chinna.
    But unfortunately that did not solve my problem
    I had to debug the function module of the respective SyncBO and found that the Profile type was not maintained in the backend.
    Infact the error "Error during date calculation: Time entered not numerical" was misleading.
    Anyways upon customising the Profile for the PJ and PV type Notifications that solved my issue.
    Regards,
    Kiran Joshua

  • I just got an Airport time capsule 2TB. When I start back-up it backs up about 17kb and then stops but says Calculating time remaining.... Anyone got an idea of what's going on?

    Just got an Airport Time capsule,
    I set it up as a network extension and began back-up.
    It estimated 4 hours so I left it run. After 10 hours I noticed it had stopped backing up but had not back up to the time capsule. So I tried again and it just got stuck on Calculating Time Remaining. I reset the capsule a few times and have set it up as instructed. The same has happened each time.
    It backs up about 17kb of info and then freezes with Calculating time remaining below the progress bar.
    Anyone any ideas?
    Thanks

    Network extension sounds onimous.. is this wireless extension.. it is super bad for large TM backups..
    Always do the first backup direct by ethernet to the TC even if it has to be in full isolation.
    Stalling at 17kb might be just the wireless having issues. Or it can be a corruption in a file.
    Pondini is our source of all things Time Machine.. and trouble shooting it.
    http://pondini.org/TM/Troubleshooting.html
    A1.. install the widget so you have access to the TM logs.. what the heck it is doing.
    A4. if you upgrade installed OS.. do a reset of TM and start over.
    A5 verify the disk.
    C9 watch out for network names that are over long and over complex.. especially with Mavericks. It is hopeless.
    I do recommend using a USB connected drive.. to do a first backup it is often the easy way.
    Much faster and more reliable than over network.

  • Calculation time as related to db size

    Hi,
    I have a database with various scenarios and versions. I have a nightly calculation (not just an aggregation) that runs on one scenario/version. As other scenarios and versions have been created, the database size has grown quite a bit, and the nightly calculation grows each time new scenario/version data sets are created. It has always been my understanding that the fix statement restricts the number of blocks brought into the calculation, and that theoretically, data existing in other intersections not being fixed on should have nothing to do with the calculation time. However, this is not my experience. I even tested it out in a development app by clearing all of the data in 8 of the other scenarios and versions and saw my calculation time cut by 27%. Does anyone know why this should be? It concerns me that as we save off more and more historical copies of the data, the calculation time on the active data will grow and grow.
    We are in the process of implementing a BSO/ASO solution to reduce the data in the BSO cube, but I don't see why it should be necessary and would like any insight into this.
    Thanks,
    Sabrina

    You may be calculating on those blocks, but the overhead of these operations grows as the database grows
    Each time it has to calculate on a block, it needs to go into the index file - find the location of the block in the .pag file, then go to the .pag file and bring that block into memory.
    I am not opposed to segregating historical data which is not used often and moving that to a separate cube from a design perspective, and really it probably would be a good idea if the cycle time on your calcs are currently taking forever.
    You can try and improve performance by modifying the cache settings - but that's performance tuning, and outside the scope of your original question.
    -Matt

  • Increasing calculation times

    Hi,
    We have a Planning 11.1.1.3 database with a nightly calculation. This calculation has been fairly stable, in terms of time, since early December, at 2 1/2 hours. Since 1/8, we have been experiencing increasing calculation times. On 1/8 and 1/9, it increased by about 15 minutes - not a huge jump, but then on 1/10, it went to 3 1/2 hours. I defragmented the database, which brought it back down to 2 1/2 hours for the next two days. Then on 1/12, it jumped to 3 3/4 hours. It seemed too soon to be fragmented, but I defragmented it anyway, but it only went back down to 3 1/2 hours. It's been hovering around 3 1/2 to 3 3/4 hours up to 1/19, when it went to 4 hours. Then last night, 1/20, it jumped to 5 hours. We did defrag again on 1/17, but that didn't touch the calculation time. On 1/12, we did change two previously dynamically calculated accounts to stored, and then calculated them. This calculation did not increase the blocks, though, just put a number into each block that had data that wasn't there previously. I did add these two accounts to the nightly calculation, but in looking at the log, the bulk of the increase is in a section of the calc that has nothing to do with those two accounts - nothing has been changed in that section of the calc at all. I can't think of anything else that could possibly account for these increasing times, and that doesn't seem like it could be the answer either. Any advice would be greatly appreciated.
    Thanks,
    Sabrina

    There could be a few things happening here...
    1) A nightly process could be running concurrently with the calc - eating up resources, making it take longer.
    2) The application may not be using actual RAM, it could be using virtual RAM. Take a look using microsoft's process explorer found here. If the ESSSVR process resides in virtual memory is will take longer. Stop and restart all of the app/dbs, and then make sure the most important/resource consuming app is started first.
    3) is everything else running slower? its possible that the server needs to be rebooted. When was the last time the server was rebooted? To determine this go to a command prompt and type systeminfo.
    Also, go back in the logs, and see how many blocks the calc is touching (reading/writing, etc). Compare what you have now (3.5 hour runs) to back in Dec or Very early Jan. If it is not any of the above, the answers are probably in the log. Is it running serially now as opposed to parallel before? executing in cell mode? etc...
    Good Luck.
    -Matt

  • Stuck in calculating time remaining, what do i do, its my second airport time capsule that i purchased as the first had a faulty hard drive, why is this soo hard!

    This is my second airport time capsule as the first i purchaed had a faulty hard drive, so now, its been a while i keep trying hoping it will work but its always stuck in 'calculating time remaining'. i thought it was my wifi so i connected directly to the capsule using an ethernet cord, bought an adaptor as i have the new macbook air (4m old) 13 inch, still not working. Help please,i am thinknig of just returning it and getting a less expeecsive and easier one to use.
    D

    Mavericks is the pain here.
    It can lose the network connection half way through a backup.
    When you connect by ethernet (good to get that.. hope it is the thunderbolt to ethernet).. did you turn off the wireless.. this is important.. nothing changes if the wireless is still on.
    I recommend you start over. Keep the wireless on for this part.
    Stop the backup.
    Factory reset the TC.
    Redo the TC setup but this time use all short names, no spaces, pure alphanumeric.
    I know the airport utility will suggest apple names..
    Fred Blog's Airport Time Capsule.
    Don't fall for it.
    Use TCgen5
    For wireless name use TCwifi (or if you want more control, TC24ghz and change 5ghz to TC5ghz).
    Wipe the current TM setup.
    Use A4 to reset it. http://pondini.org/TM/Troubleshooting.html
    With wireless off now and just ethernet connection try the backup again.
    No luck manually mount the TC hard disk in finder. Go/Connect to Server.
    AFP://TCname.local (replace TCname with your new nice short name.. and use the domain which is local by default).
    OR
    Use AFP://10.0.1.1 (Replace with whatever IP the TC uses.. but it must be static.. easy for router mode.. not so easy if the TC is in bridge mode).
    The Computer will request the password.. type in whatever password you used for disk access.. by default it ithe device password. If you did not change it then default is public.
    This setup has worked for other people.
    https://discussions.apple.com/thread/5951390?tstart=0
    I cannot guarantee you won't need to reboot the TC oocasionally as it does fall over.
    There are other bits that I keep forgetting..
    Make sure ipv6 is set to link-local for both wireless and ethernet in the computer.
    Once you finish the main backup the short incremental backups can work over wireless.. so just turn wireless back on.

  • Time Machine : incredible calculation time required

    I have started backing up with Time Machine and this is an example of what it gives .
    In the beggining it calculated 6.000 days and after thirty minutes or so , it got to that conclusion .
    I have done the full reset of Time Machine and restarted the procedure but nothing changed .
    Currently , it needs 654 days .
    It doesn't seem to make any progress.
    What is the deal here?
    Shall I leave it or does it need fixing ?
    Thank you and have a great weekend.

    Ok, now it has reduced the time in eight hours and it's progressing .

  • Calculating time for different timezone, problems with daylight savings?

    Hi all,
    I try to convert my locale time to a different timezone (like a world clock does). This worked until Europe got "summer time". Then my time calculation went wrong. I just paste the following coding to give you a quick reproducable code.
    I did a lot of googleing but nothing found so far. Also search here in the forum didn't help me solving it. So now I created a post on my own.
    The output of the Java programm is the following (without the colored comments). I just entered these comments to show you where the calculation is right and where it goes wrong.
    I have absolutely now idea about where the chase the error. I am only guessing with "daylight savings issue".
    Hopefully anybody has a good idea.
    Thanks in advance
    John
    Europe/London {color:#339966} *(correct calculation!)*{color}
    daylight shift in millis: 3600000
    Is in daylight savings: true
    19.04.2010 11:28:53
    *Europe/Berlin {color:#339966}(correct calculation){color}*
    daylight shift in millis: 3600000
    Is in daylight savings: true
    19.04.2010 12:28:53
    Australia/Sydney{color:#ff0000} (wrong calculation, shoul 1 hour){color}
    daylight shift in millis: 3600000
    Is in daylight savings: false
    *19.04.2010 20:28:53*
    America/New_York {color:#339966}(correct calculation){color}
    daylight shift in millis: 3600000
    Is in daylight savings: true
    19.04.2010 06:28:53
    Asia/Bangkok {color:#ff0000}(wrong calculation, shoud 1 hour){color}
    daylight shift in millis: 0
    Is in daylight savings: false
    19.04.2010 17:28:53
    Asia/Hong_Kong {color:#339966}(correct calculation){color}
    daylight shift in millis: 0
    Is in daylight savings: false
    19.04.2010 18:28:53
    package test.timezone;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.TimeZone;
    public class TZCalc {
    public static void main(String[] args) {
    List<TimeZone> list = new LinkedList<TimeZone>();
    list.add(TimeZone.getTimeZone("Europe/London"));
    list.add(TimeZone.getTimeZone("Europe/Berlin"));
    list.add(TimeZone.getTimeZone("Australia/Sydney"));
    list.add(TimeZone.getTimeZone("America/New_York"));
    list.add(TimeZone.getTimeZone("Asia/Bangkok"));
    list.add(TimeZone.getTimeZone("Asia/Hong_Kong"));
    for (TimeZone tz : list) {
    Calendar cal = new GregorianCalendar(tz);
    SimpleDateFormat formatter = (SimpleDateFormat) DateFormat
    .getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
    formatter.setTimeZone(tz);
    System.out.println("\n"  +tz.getID());
    System.out.println("daylight shift in millis: "  tz.getDSTSavings());
    System.out.println("Is in daylight savings: "  tz.inDaylightTime(cal.getTime()));
    System.out.println(formatter.format(cal.getTime()));
    }Edited by: jbegham on Apr 19, 2010 3:46 AM
    Edited by: jbegham on Apr 19, 2010 3:47 AM

    You should not set the time zone on the calendar since you want the calendar based on UTC.
            List<TimeZone> list = new LinkedList<TimeZone>();
            list.add(TimeZone.getTimeZone("Europe/London"));
            list.add(TimeZone.getTimeZone("Europe/Berlin"));
            list.add(TimeZone.getTimeZone("Australia/Sydney"));
            list.add(TimeZone.getTimeZone("America/New_York"));
            list.add(TimeZone.getTimeZone("Asia/Bangkok"));
            list.add(TimeZone.getTimeZone("Asia/Hong_Kong"));
            Calendar cal = new GregorianCalendar(); // Regardless of your timezone this holds the number of milliseconds since 1/1/1970 UTC.
            for (TimeZone tz : list)
                SimpleDateFormat formatter = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
                formatter.setTimeZone(tz);
                System.out.println("\n" + tz.getID());
                System.out.println("daylight shift in millis: " + tz.getDSTSavings());
                System.out.println("Is in daylight savings: " + tz.inDaylightTime(cal.getTime()));
                System.out.println(formatter.format(cal.getTime()));
            } I have no idea whether or not this then gives the results you expect.

  • Calculating time until a next monday

    Hi,
    I am trying to get a good calculation to set the initial delay of a timer. I am implementing a scheduler which will fire every monday at 16:00. If my applications starts I need to calculate how many milliseconds are left from now until the next monday 16:00 for the first trigger.
    I tried several simple calculations but i can't get it right.
    Does anyone know a simple trick or method which does this for me?

    Hi,
    you can try it with:
    //define a start day
    java.util.Date today = new java.util.Date();
    Calendar cal = Calendar.getInstance();
    //set next monday
    cal.setTime(today);
    cal.add(Calendar.WEEK_OF_MONTH, 1);
    cal.set(Calendar.DAY_OF_WEEK, 1);
    cal.set(Calendar.HOUR, 16);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.MILLISECOND, 0);
    //calculate miliseconds from start date
    long milisecLeft = cal.getTime().getTime()-today.getTime();Hope it helps
    regards

  • Calculating time lapsed using Now function

    I have a column named Time Lapsed which is the difference between the present time and the event occured time. How will I use now() function to evaluate. let's say I have a datetime field called 'EventTime'. I tried the following calculation
    now() - EventTime but doesn't seem to work. Please advise.
    Thanks

    Hi Payal,
    I created a data object calculated field "Now" : Now()
    and a calculated field TimeSpan : Now - EventTime
    where EventTime field is a datetime field which gives when the event occured.
    Issues faces is the TimeSpan field should keep ticking like a Stopwatch, but this one only gives the value on loading.
    How will I get around this. Any use case?

Maybe you are looking for

  • Project Siena app Publish Issue

    Hi all, I have just started creating Siena App and created simple translator app, its working fine but when I try to publish it using File-->Publish it shows me a warning prompt saying "Download Update require" when I click on "Download" the another

  • How to specify different horizontal restore & collapse icon for af|panelSplitter using Skinning based on Style class or position?

    Hello, I am trying to provide different horizontal restore & collapse icon for af|panelSplitter using Skinning based on Style class or position. I have 2 af:panelSplitter with orientation="horizontal" - One with positionedFromEnd="true" one with posi

  • Problem in picking up the data from queries in QA and PRD

    Dear Experts We have upgraded our Development server from 3.5 to 7.I have used Role Menu web template.As this template is default for all users,When i execute these reports in DEV,it gives this URL and gives the data from Dev. http://cibdm.ncsbe.eu.j

  • Multiple POs wrongly linked to SO

    Hi, I have got a Sales order which is wrongly linked to 23 different Purchase orders. The SO created only 1 requisition. But the PO that was dropped from that req is not showing in the document flow of the Sales order. 23 wrong POs are getting displa

  • Posting on COPA through BAPI

    Dear Experts, want to transfer some value in copa at the time of interface (Revenue and Cost booking). financial data will be transferred from interface to SAP system. Which bapi i will use in order to post data in COPA.FI is using standard bapi_ACC_