Java script question: about GMT time

Hi,
i'd like to get a GMT time. using javascript below:
function setTime(){
var a = new Date();
a = a.toGMTString();
but after output the a's value, i found it's:
Tue, 28 Aug 2001 04:11:01 UTC
the format is GMT's format, but the string shown in the end isn't GMT, but UTC. why? and how to change it to
Tue, 28 Aug 2001 04:11:01 GMT ?

I would guess that, at least with 1.3.1, you will have to do it yourself.
  java.util.TimeZone t = java.util.TimeZone.getTimeZone("UMT");
  System.out.println("tz=" + t.getDisplayName());
.The above displays the time zone as GMT, even though UMT was selected.
Presuming that UMT=GMT (web search revealed some conflicts and my definitive work is not available) then the following should do it.
  java.text.SimpleDateFormat f
      = new java.text.SimpleDateFormat("EEE d, MMM yyyy HH:mm:ss");
  java.util.TimeZone t = java.util.TimeZone.getTimeZone("UMT");
  if (t == null)
    throw new Exception("No UMT zone");
  System.out.println("tz=" + t.getDisplayName());
  f.setTimeZone(t);
  java.util.Date d = new java.util.Date();
  System.out.println("d=" + f.format(d) + " UMT");

Similar Messages

  • Some questions about a Time Capsule

    Hi!!
    I just have a few questions about a Time Capsule, but first let me explain the backgroud to my questions.
    I live in a 2 floor house(including a basement) and my bedroom is downstairs. My parents currently have a desktop PC connected to our wireless router and our printer. Me and my step-father both have 13 inch MacBook Pros, and he uses the Mac like a basic computer, so the equipment connected to our PC is good for him. I, on the other hand, use my Mac, iPad and iPhone to their fullest potential. I am a SUPER MEGA NERD when it comes to computers, so I plan on making my bedroom an amazing office at the same time. So I want an AirPrint Enabled printer in my bedroom (Under 100$$) along with a Time Capsule to back up my information, because everyday I look around in the backdoor of my Mac alot, and if I jack anything up (And I cant handle the problem) I would like to restore my Mac to a previous version. So here are my questions:
    1) My bedroom is right underneath our router, so i get GREAT Wi-Fi in my room. If I get a Time Capsule, can I use it in my room to extend my Wi-Fi, and how would that work? Will it extend my wifi under the same name, because I would like my own Wi-Fi (Titled to what I want with my own password)
    2) If I have to create a NEW Wi-Fi network, how would I do that?
    3) Would I need to connect my new printer directly to my ROUTER, or could I connect it to the TIME CAPSULE?
    If you don't understand what I'm trying to ask (Even though I feel like it's self-explanatory)
    ONE question about the PRINTER: Do any of you have any recommendations for an AirPrint Enabled printer under 100$? Even under-150$ would be okay.
    THANKS FOR ANY HELP!!!!

    everyday I look around in the backdoor of my Mac alot, and if I jack anything up (And I cant handle the problem) I would like to restore my Mac to a previous version. So here are my questions:
    Don't just depend on TM.. use a disk image type utility.. either one of the Mac tools, SuperDuper, CCC, Chronosync or even a linux boot cd (if you have a cd/dvd drive still or via usb can boot) a great tool is Clonezilla.. it will do basically any computer, Mac, Linux, Windows.. and since it boots into its own OS can restore a computer in a flash. Then you can add the incremental changes from TM.
    1) My bedroom is right underneath our router, so i get GREAT Wi-Fi in my room. If I get a Time Capsule, can I use it in my room to extend my Wi-Fi, and how would that work? Will it extend my wifi under the same name, because I would like my own Wi-Fi (Titled to what I want with my own password)
    Actually I am surprised you get good wireless as usually directly above or below a router is often the worst spot. Time Capsule cannot extend the wireless of any other router than Apple.. it is a special system and only Apple can join the club. It has bad effect though, if you set the TC to extend wireless it turns off ethernet ports.. which is hugely dumb.
    The best arrangement is ethernet to the upstairs.. or EOP adapters. If not then a wireless router that matches the existing unit will generally be better than mixing apple and non-apple.
    2) If I have to create a NEW Wi-Fi network, how would I do that?
    3) Would I need to connect my new printer directly to my ROUTER, or could I connect it to the TIME CAPSULE?
    You create a new wireless network by selecting manually the wireless channel and use different wireless name, ssid and security. There are 3 available channels on 2.4ghz.. your existing router will use one or two.. depending on if the setting is 20mhz or 40mhz.. so you need to manually set everything and not use auto.
    TC is slow on 2.4ghz cf 5ghz and there are many more channels at 5ghz but not everything can use it.. iphone for instance is 2.4ghz only . whereas ipad can use 5ghz.. most full computers now can use 5ghz.
    Buy a wireless network printer. Or alternatively an ethernet network would be also ok but now are more expensive than wireless ones. Network printers are not much more than straight USB and work much better.
    I do not use airprint so have nothing to offer.. find the best HP model in your budget.. but others may have had more experience.. I use ethernet connected b/w laser business type HP.. they work great.. but airprint is too recent an innovation for me.

  • Can I post here(Acrobat Windows) Java Script questions here?

    Hello
    Can I post here(Acrobat Windows) Java Script questions here? If not, wht is the correct forum?
    THank you

    Back up and down to Acrobat Scripting. Bot Windows and MacIntosh Acrobat versions use the same JavaScript.
    If you are using LIVECYCLE DESIGNER use their forums. The JavaScript syntax and objects are different in LIVECYCLE DESIGNER!

  • Few questions about Oracle Times ten

    Moved to Few questions about Oracle Timesten
    Edited by: ankurk on Nov 4, 2010 6:50 PM
    Moved to right place... timesten

    Hi,
    it is better to ask in the [url http://forums.oracle.com/forums/forum.jspa?forumID=244] Times Ten Forum.
    Herald ten Dam
    http://htendam.wordpress.com

  • Question about compile-time legality rules for cast conversion

    Hi, In the rules which explain compile-time legality for cast conversion, it is often mentioned the following scenario in the cast conversion of a compile-time type S to a compile-time type T:
    if S is a class type then:
    if T is a class type then either |S| <: |T| or |T| <: |S| or a compile time error occurs. Furthermore, if there exist a supertype X of T and a supertype Y of S such that X and Y are provably distinct parameterized types and that the erasures of X and Y are the same, a compile-time error occurs.
    As regards the quote in bold, I imagine the following scenario:
    1) S <: T and extends Y
    2) Y<T1...Tn>
    3) X<T1..Tn>
    4) T extends X
    Does the above represents a supertype X of T and a supertype Y of S such that X and Y are provenly distinct parameterized types? If that holds, what does it mean that the erasure of X and Y is the same?

    Declarative programing has all but gone the way of
    the doe doe because...
    1: It is not flexible (It is extremely difficult to
    change a complex system in a predetermined way)isn't this the "expert system" model?
    2: It lengthens the development cycle (see item 1)
    3: It normally forces the developer to add many
    things to there code to get things to work, that have
    nothing to do with the intent of the code.more things? the declarations or the declaration processing?
    In its defense (I like a declarative model but, do
    not like being forced into one)...not advocating a forced change in Java
    1: It increases code safety.
    2: It can shorten the development cycle, in certain
    circumstances (especially if it is not overused),
    because it can greatly increase the readability of
    code.
    3: It follows many best practices (although this is
    also possible in a Non-Declarative model).as for best practices what I'd like to see are declarative design patterns, Adapter, Singleton, Factory, Delegate, Strategy, Interpreter, Proxy, Visitor
    too often the design intent is lost in an implementation or design details can only be deduced by class/field/method names, comments, and accompanying docs
    So, if everyone had unlimited time, and an unlimited
    budget, yes declaritive is the way to go. Since that
    is not the case, we filtered out 99% of what it gave
    us, made sure the stuff that was getting in the way
    was removed, and what do you have???
    You guessed it OOA&D.
    Now having said that should we be more declarative? I
    think so, but I will tell you now, REQUIRING
    declarative elements in code is a sure fire way to
    get the majority of development groups to drop the
    language (and I think Java as it stands currently CAN
    be declarative, so if you have one of those unlimited
    budgets, go for it!).no need to require it
    I believe given good (reusable) declarative options, on top of OOP, will become the chosen approach
    reusable design declarations would lessen overall cost and increase readability

  • Easy question about install time

    Hello,
    I have been having a lot of problems with my MacBook and after posting on the forums it seems a re-install might help. This is my firt time doing a wipe/install so I backed up my files and booted from my Tiger install DVD and did a wipe/install and I am staring at in installing right now. It seems to be taking forever! It has been going for about 2 hours now and is about 1/3 of the way finished and says it has 3 hours 43 minutes to go. Is it supposed to take this long?

    Hi,
    I haven't installed Tiger on an Intel Mac but have installed Jaguar, Panther and Tiger a number of times on PPC Macs. It never took more than 30 minutes to complete.
    I would suggest you let the installation run its course and then see how the computer is working.
    It might be that your HD needed repairing... did you check it with disk utility before starting the installation ?
    One more thing... after the first boot (where you set up accounts,etc) you should boot from the install DVD check the disk with disk utility and repair if necessary.
    S

  • Question about the Timer Objects

    According to the API docs, the method Schedule for a Timer object takes the following constructor:
    schedule
    public void schedule(TimerTask task,
    Date time)
    Schedules the specified task for execution at the specified time. If the time is in the past, the task is scheduled for immediate execution.
    Parameters:
    task - task to be scheduled.
    time - time at which task is to be executed.
    Source: [link]http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html[link]
    However, I am getting the following error:
    The method Schedule(TimerTask, Date) is undefined for the type Timer.
    Any idea why I would be getting this message?

    However, I am getting the following error:
    The method Schedule(TimerTask, Date) is undefined for
    the type Timer.
    Any idea why I would be getting this message?Yeah. Could be 2 things:
    1. It's "schedule" not "Schedule" (case matters)
    2. You're using java.sql.Data instead of java.util.Date.

  • Question about Run-Time Shortcut Menus example

    I am looking at the Run-Time Shortcut Menus.vi that ships with LabVIEW2011. There is an event case "Test List":Mouse Down that does nothing but generate a Val(Sgnl) event for the "Test List" control if the right mouse button was pressed. There is no value change event for that control.
    Is there an obscure reason to do that? One thing I have learned about many of the examples is not to strictly use them as examples.
    =====================
    LabVIEW 2012
    Solved!
    Go to Solution.

    Nevermind - I found the obscure reason. Even though there is not a value change event, generating the value change event is required to change the value on right-click.
    At least NI could have documented this in the example
    =====================
    LabVIEW 2012

  • Question about the Time Capsule as an external hard drive...

    i know this might be a kind of dumb question, but does the time capsule also work as an external hard drive where i would be able to just drag and save whichever files i want...or does it only save files through backing up in time machine??? thank you in advance

    You don't need to consider FAT32 formatting for PC access.
    The closet thing to a "format" of the TC disk is via "erase" command in the Airport Utility. There's no consideration of truly formatting or in what format the disk would be laid out. For the USB attached drive the same applies when it is attached to the TC, but of course it can be formatted when directly attached to a PC or Mac.
    It is, in fact, often recommended that a USB attached drive be formatted as HFS+.
    The fact that the drive (either the TC drive or a USB attached drive) are accessed via network protocols as a network disk insulates the useing machine from the physical drive format details to a large degree.
    I have a TC with a USB attached drive. Both the TC drive and the USB attached drive are formatted as HFS+ but appear on Windows XP machines as:
    Type: Network Drive
    File system: FAT32
    There has been a lot of discussion of this in this forum:
    <http://discussions.apple.com/message.jspa?messageID=7540393#7540393>
    Message was edited by: Steve Holton
    Message was edited by: Steve Holton

  • Quick question about using Time Machine on iMac FireWire external

    I have been backing up my MacBook using Time Machine via a USB external hard drive that is connected to my iMac. Now when I look at the Time Machine setting in my MacBook is says that the MacBook NEEDS to be plugged in in order for the next backup to occur. This is no issue for me, but I am wondering if this has always been the case. It may have been something that I overlooked, but I do not remember seeing that message when using Time Machine over my network on my MacBook before.

    Yes, that's correct. TM will not backup a laptop while it's operating only on battery unless you upgrade to 10.5.3. This latest version provides a TM option to run backups when the computer is on battery power.
    It's inadvisable to run a backup while on battery power because if the battery goes dead your backup could become corrupted. At the very least files may not get backed up as expected.

  • Question about wiring Time Capsule

    Just bought a 2 TB Time Capsule but haven't hooked it up.
    Currently, I'm using an old D-link wireless router that's hooked up with the cable going first into the router, then out to my primary iMac. Our other two computers connect to it wirelessly
    With Time Capsule, should I hook it up to my iMac in this same manner, or would it be better just to let it communicate wirelessly?
    Or does it even make a difference?

    Connecting your iMac wirelessly vs by ehternet cable?
    It shouldn't make any difference either way, it's up to your preferences and desires.

  • Java Script Question (No Toolbars, ... for whole application)

    Hi Everybody!
    I have the following problem. We have created a web-application, which consists of about 100jsp pages and several class-files.
    Now we want to hide the toolbar, the menubar and the addressbar for every jsp page in the application. I know, that normally this is done by using window.open(...) but then I had to alter every link in the nearly finished system.
    Is there another possible solution to achive this goal with minimum effort?
    Thanks in Advance!
    Stef

    no, but why do you have about 100 window.open() calls? Most web applications don't jump between windows. And it's not like you can hide that stuff in the current window anyway.

  • General Question about crawl times

    I am just curious what some experts would think of using SharePoint search assuming with FAST to crawl/index 7 million+ resumes. And then querying this index for a very specific sets of terms.
    All things being equal, and assuming I have plenty of hardware and network.(any other assumptions?)
    How long would you expect it to take to crawl all those documents?  I think query results would be very fast based on demos I have seen.  But I am curious about crawling large volumes of data.  And then continuously adding to this data, and
    re-indexing, and incremental indexing...  My presumption is that I would probably need 1 full crawl per day(probably overnight), with incrementals throughout the day.  But that assumes SharePoint can index all that data within 8-10hrs?  Is that
    a realistic expectation?
    This would all be in comparison to a dtsearch based product.  I don't know much about it, just know that's the product a lot of people use for this...
    Any input is appreciated.
    Joshua Fuente

    FAST doesn't exist in 2013. Is this in the wrong forum?
    Under 10 million items is classed as a small farm, in case studies you can get in the region of 45- 130 items per second with a single crawl server depending on details. For 7 million items that's in the region of 40 - 17 hours. Adding a second crawl server
    will pretty much cut that in half and you can scale that out heavily if you really needed.
    You don't need to do full crawls every night, it's farily common to have a weekly, or less frequent, full crawl in medium to large organisations. I like having them regularly and enough power to do ad-hoc crawls for changes such as adding mapped properties
    but weekly and multiple daily incremental crawls are normally more than sufficient.
    Have a look at these, 2010, case studies and lab tests:
    http://technet.microsoft.com/en-us/library/gg750251%28v=office.14%29.aspx

  • Question about the time calls

    Hi, I have iPhone 3Gs and I want to see how many minutes I have outgoing calls because the iPhone has only a total time in which they received calls and outgoing calls. Please, no free APPS, which it calculates?
    p.s.: I'm sorry for my english

    You know, iphone maybe is the best phone ever... and it doesn't include this very simple feature. Unfortunately the only way to solve this issue is by jailbraiking which is not supported by apple.
    I hope (and I really mean it) in the next version apple include that feature which is included in all cheap mobiles.

  • Question about loading time determination in OVLZ

    Hello,
    In t-code OVLZ, field "Determine load. time", the F1 explanation is bellow:
    -No loading time determination
    No loading time is determined
    -A Route-dependent
    A route-dependent loading time is determined.
    Influencing factors are the shipping point, the route, and the loading group
    -B Route-independent
    A route-independent loading time is determined.
      Influencing factors are the shipping point, the route, and the loading group of the material.
    can somebody tell me what is the difference between A B? It seems to be the same according to the 2nd line explanation of B.
    Thanks,
    Gunadi

    hi,
    in OVLZ-shipping point- working hours
    determine load time: the option A -stands for route dependent
    means loading times is determined with combination of shipping point+ route+ loading group
    option B- stands for route Independent
    Means  loading time is determined with comnination of shipping+ loading group
    the loading time will have effect on delivery sch ie., taken into account for forward scheduling else backward scheduling
    hope this help u
    regards,
    Arun prasad

Maybe you are looking for

  • Ora file in oracle linux 6

    hi which packages must i install in order to be able to read /u01/app/oracle/product/11.2.0/db_1/dbs/initsmsdev.ora and how to create initsmsdev.ora as am also having problem startup pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initsmsdev.ora' LRM-

  • Fastest way to get data from Multiple lists across multiple site collections

    HI I need to get data from multiple lists which spread across 20 site collections and need to show it as list view. I have searched on internet about this and got some info like options would be to use search core APIs or BCS . I can't use search bec

  • ORA-20001: ORA-29902: error in executing ODCIIndexStart() routine

    Hi, everyone! I have an error as follow: ORA-20001: ORA-29902: error in executing ODCIIndexStart() routine ORA-06553: PLS-123: program too large I can get the sql where the procedure through the error, and execute the sql in sqlplus, no error. Does a

  • Does LabVIEW DSC 8.5 support Windows Server 2008?

    Hi, I am developing a SCADA system using LabVIEW DSC 8.5. Apparently, customer wants the Server Computer to be latest Windows Server 2008 operating System. But the Release and Upgrade note specify that DSC Module does not support Windows NT/Me/98/95/

  • Failed to load library 'olepro32.dll'

    Just downloaded the full version.  Running Windows 7 64bit.  Get the above message. Suggestions?