Anyone know how to get current time using Java?

Hi,
do anyone know how to use system.currentTimeMillis() to get the current time?
I know that system.currentTimeMillis() get the time between current time and midnight, January 1, 1970 UTC. but how to use it to get the current time format?
Thank you very much.

Hi,
do anyone know how to use system.currentTimeMillis()
to get the current time?
I know that system.currentTimeMillis() get the time
between current time and midnight, January 1, 1970
UTC. but how to use it to get the current time format?
Thank you very much.
long timeInMillis = System.currentTimeMillis();
Calendar c = Calendar.getInstance();
c.setTime(timeInMillis);
Date d = c.getTime();And format using SimpleDateFormat:
SimpleDateFormat sdf = new SimpleDateFormat("dd-mm-yyyy HH:mm:ss");
String formattedDateString = sdf.format(d);

Similar Messages

  • I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !

    I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !
    I also tried resetting settings all to no avail ...I looked up some advice and watched utube video advice on how to fix without success..
    The volume control button on side does not work ,I got the iPad last August and wonder if it is a fault that means I must return it for replacement from where it was purchased ?

    The Retrospect you used way back when is no longer around. The company was sold and that company produced a new version of Retrospect - Retrospect 8.x
    So, as you've been told, you would have to be running a Tiger system with an old version of Retrospect software (5.x or 6.x - you would need to know) assuming you can find the software.
    As best I can remember you cannot extract files from a Retrospect backup except using the software since Retrospect did not normally make a file by file backup rather it created an archive of the files in the backup. I'm assuming that the EMC/Retrospect people have told you that old Retrospect backups are not accessible by Retrospect 8.x?

  • Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Hi connally25,
    Below is a link to a video tutorial on how to add a Facebook Log button, please check if you have followed the same steps to add the video.
    http://tv.adobe.com/watch/learn-adobe-muse-cc/adding-a-facebook-like-button/
    If you have followed the steps correctly and the button still does not work; here is a link to a forum thread which might help solving the issue:
    Facebook Follow Widget not working
    Regards
    Sonam

  • Please help! We got a used Mac Mini and we don't have the former owner's password, so we can't install anything like flash player.  Does anyone know how to get around this?

    Please help! We got a used Mac Mini and we don't have the former owner's password, so we can't install anything like flash player.  Does anyone know how to get around this? I don't know how to wipe the hard drive, and the support online doesn't seem to work.

    As posted previously:
    Reinstall OS X without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    If installing Leopard the process is similar in some respects.  If you wish to begin anew then after selecting the target disk click on the Options button and select the Erase and Install option then click on the OK button.  To install over an existing system do the following:
    How to Perform an Archive and Install
    An Archive and Install will NOT erase your hard drive, but you must have sufficient free space for a second OS X installation which could be from 3-9 GBs depending upon the version of OS X and selected installation options. The free space requirement is over and above normal free space requirements which should be at least 6-10 GBs. Read all the linked references carefully before proceeding.
    1. Be sure to use Disk Utility first to repair the disk before performing the Archive and Install.
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger, Leopard or Snow Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Do not proceed with an Archive and Install if DU reports errors it cannot fix. In that case use Disk Warrior and/or TechTool Pro to repair the hard drive. If neither can repair the drive, then you will have to erase the drive and reinstall from scratch.
    3. Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When you reach the screen to select a destination drive click once on the destination drive then click on the Option button. Select the Archive and Install option. You have an option to preserve users and network preferences. Only select this option if you are sure you have no corrupted files in your user accounts. Otherwise leave this option unchecked. Click on the OK button and continue with the OS X Installation.
    4. Upon completion of the Archive and Install you will have a Previous System Folder in the root directory. You should retain the PSF until you are sure you do not need to manually transfer any items from the PSF to your newly installed system.
    5. After moving any items you want to keep from the PSF you should delete it. You can back it up if you prefer, but you must delete it from the hard drive.
    6. You can now download a Combo Updater directly from Apple's download site to update your new system to the desired version as well as install any security or other updates. You can also do this using Software Update.

  • I can't get the AirPlay alert to stay off my Apple TV. I'm using AirPlay so it's not trying to connect. It's an alert that tells me what AirPlay is. Anyone know how to get rid of this?

    I can't get the AirPlay alert to stay off my Apple TV. I'm using AirPlay so it's not trying to connect. It's an alert that tells me what AirPlay is. Anyone know how to get rid of this?

    Welcome to the Apple Community.
    Settings > AirPlay > Conference Room Display > Off.

  • I am trying to update my iphone 3GS software but itunes just says that this is the current version of itunes, it does not see the phone update - anyone know how to get the phone updated?

    I am trying to update my iphone 3GS software but itunes just says that this is the current version of itunes, it does not see the phone update - anyone know how to get the phone updated?

    Mike
    I have done that and it is through pressing that update, which tells me that there is anew version of iphone software, that the prompt comes telling me that this is the current itunes?

  • Does anyone know how to get an application you had once without using App Store?

    Does anyone know how to get an application you had once without using App Store?
    Because I'm underage and I couldn't get it back.
    I just want it back, I'm not going to use any money in App Store...

    When you say you "had it once", how did you get it then?  The App Store has only been around for a few years, so there are lots of apps out there that you would once get from the developer, but now they're only available on the App store.  Which app(s) are you referring to? 

  • Does anyone know how to get an ipad to use the wireless network from an airport?

    Does anyone know how to get an Ipad to use the wireless network from an airport express?

    By default, the AirPort Express will broadcast an unsecure wireless network with a Network Name of something like: Apple Network NNNNNN. Your iPad should "see" this network and be able to connect to it. Have you tried going through the iPad's Settings > Wi-Fi > Choose a Network... option. If so, does the AirPort's wireless network appear in the list of available networks?
    Can other wireless devices connect to the AirPort's network?

  • When I'm on an app, on iso7.1 it will now show the "iPad/iphone" sign the time and the battery whilst running in an app. does anyone know how to get rid of that as its effecting the games i play.

    when I'm on an app, on iso7.1 it will now show the "iPad/iphone" sign - the time - and the battery whilst running in an app. does anyone know how to get rid of that as its effecting the games i play.

    If you can hide the status bar, it would be an option inside the app. I have one or two apps where that is an option but in most apps it is not.

  • Does anyone know how to get Adobe to stop charging for a subscription that is no longer being used?

    Does anyone know how to get Adobe to stop charging for a subscription that is no longer being used?

    For full details on cancelling a membership and subscription see the following page:
    Cancel your membership or subscription | Creative Cloud
    Depending on where you are in your subscription cycle / membership and the type of membership
    If you have an individual membership, and opted for the annual membership (lower monthly fee). If you are cancelling in the middle of your membership, then you would be billed 50% of what's left of your membership for the remainder of the year, basically that would then in $$s become more like having taken out a month-by-month membership (higher monthly membership fee).
    If you are in the last month of your annual membership or your are on a month-by-month membership, you can log into your creative cloud account, cancel the plan yourself (no additional charges apply), by logging in with your Adobe ID and password, click your name in top left of screen and click on Manage Account.

  • Does anyone know how to get a hold of someone in charge of QA

       Customer support is dire! I have spent long hours dealing with costumers service <whose only modes of help are sending me out to buy something new or provide me with a hyperlink to help page that was two clicks away anyway> Between thier lack of knowledge and SARCASTIC JABS it's amazing that I have retained my sanity. I won't go into details but I'll catch you up. 4 sessions in live chat with LOOOONG delay in between responses and I can not make recovery disc, my phono jack does not function properly, my system can not communicate MTP <you know, what you use to fill your ipod, and I kid you not there is a fan LITERALLY RATTLING AROUND inside my 2 month old notebook. So what do I do? I exhaustively seach for away to get a hold of customer service, and all I can find are blogs about how HP costumer service sucks. Bear in mind that I did not put suck into my search engine. I put "HP QA and HP customer service" into google and what returned was BLOGS ABOUT HOW HP CUSTOMER SERVICE SUCKS. Those were the most relevant results in google. So I finally come to this forum and find a thread about..........you guessed it hp customer service sucking.....but oh no an HP moderator locked it down and provided a link to the page where one can obtain the very customer service that has been deemed insufficient by the very COMMUNITY that it is supposed to support. WE PAYED YOU PEOPLE! YOU ARE HERE FOR US NOT WE FOR YOU.
     Does anyone know how to get a hold of someone in charge of QA
    I will eventually shake the correct bush and flush someone out and I will share my information.......any advice COMMUNITY?

    Hi zach317,
    Thank you for visiting the HP Support Forums.  As stated in the thread you have cited, the purpose of this forum is to give feedback or make suggestions on ways to improve the forums.  Should you have feedback on other issues, please contact HP directly using this link.  This is a user-to-user forum, so you'll have to use this link for direct assistance from HP.
    Many members of the community are extremely knowledgable. If you're having an issue you believe the other users in the community may be able to assist you with, please feel free to find the appropriate forum and post your question there. 
    Should you have any further questions or concerns, you can send a Private Message to me or another moderator or admin at any time.
    Thank you!
    Message Edited by SandyD on 11-22-2008 03:03 AM
    Clicking the "Kudos star" to the left is a great way to say thanks!
    When your problem has been solved, accept the solution by clicking the "Accept as Solution" button to help other members in the future!
    Rules of Participation

  • HT204406 "Error 4001 with iTunes Match" does anyone know how to get rid of it?

    When trying to setup Match with Itunes I get error message 4001. Does anyone know how to get rid of this? I am on the most current version of Mountain Lion and I have upgraded to the latest version of iTunes. Error message occurs every time I try to setup match.

    Yep! I got the same thing. (and the failure to launch full screen mentioned elsewhere).
    Please let me know if you find a way to sort this out.
    Ta!

  • It appears my kid has erased my entire iTunes and iPhoto libraries.  Anyone know how to get them back?

    My kid has erased my entire iTunes and iPhoto libraries.  Does anyone know how to get them back?

    WIthout a backup of your data previously, they are all gone.
    The only option you have now is data recovery.
    You need to purchase, download, install and use a data recovery app like this.
    http://www.prosofteng.com/products/data_rescue.php
    You need to completely stop using your computer ASAP, at this point and just run the data recovery app and let it do its thing.
    Every moment that you keep regularly using your computer risks rewriting new data in the locations where your deleted data may still reside.
    A very expensive and time consuming lesson to be learned here.
    Purchase and connect up a large capacity external hard drive (a drive larger than your Mac's internal hard drive) preferably a hard drive that uses FireWire 400/800 connection and use a data cloning app like CarbonCopyCloner or SuperDuper to make yourself a exact, bootable copy of your Mac's internal drive to the new external hard drive.
    This will be your data backup drive.

  • Hi I have a new iPhonei 4S and my ringtones are missing anyone know how to get them back. P. s I don't have a computer

    Hi I have a new iPhonei 4S and my ringtones are missing anyone know how to get them back. P. s I don't have a computer

    When you say "account," do you mean your iTunes library, because your iTunes library is what is on your computer?  Your iTunes library does not have an email address.  An account that is related to iTunes is your Apple ID (which is an email address) and you use it as your user name to sign in to the iTunes Store, to make purchases.  Changing your Apple ID will not make songs disappear from your computer's iTunes library.
    If you had an Apple ID and used it to make song purchases from the iTunes Store, and then started using a different Apple ID, you should be able to re-download the songs purchased with the old Apple ID.  In iTunes, sign in to the iTunes Store using your OLD Apple ID (and password).  That may not be your current email address, but Apple uses it as your user name, so it does not matter.
    On the iTunes Store Home screen, click on Purchased under QUICK LINKS.  This takes you do the Purchased screen, where you can re-download previous song purchases (for that Apple ID) at no cost. 
    NOTE:  If those song purchases are from more than a few years ago, you may also need to authorize your computer to play (and sync) songs for your old Apple ID. 
    For songs that were not purchased from the iTunes Store, if they are also gone, you cannot get them back unless you have a backup (or they are still loaded on your old iPod).
    If that's not what you mean by "changed the email address on my account," please post back with more details.

  • Does anyone know how to calculate the impedance using waveforms

    does anyone know how to calculate the impedance using waveforms?

    studentproject wrote:
    the waveforms represent the voltage and current values across a capacitive load. I am trying to find out if there is a way to do automatic calculations using the inputs from the waveforms
    Hopefully a single sinusoid tone.  Otherwise things get really interesting.  Also know that impedance is based on the frequency.  I'll have to dig into this again.  I have not had to calculate an impedance in well over 10 years.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Can you help me? Error 9 when updating

    Log file 2014-03-15 15:10:52.000 iTunes[205:707]: restore library built Jan 31 2014 at 16:40:15 2014-03-15 15:10:52.000 iTunes[205:707]: iTunes: iTunes 11.1.5 2014-03-15 15:10:52.000 iTunes[205:707]: iTunes: Software payload version: 11D167 2014-03-1

  • Left channel not working--it's a logic problem, but I can't debut it! HELP!!!

    I'm using a SB Audigy SE card on my XP machine. In the past, I've made good music files from CDs and records (remember those?), but I have not used the thing in about 18 months, and now I'm having a weird problem. I get output only on the LEFT channe

  • Sony Handycam and MacBook Pro via Firewire 800

    Hi there, I'm trying to connect my Sony Handycam (HC30E) to my MacBook Pro via the Firewire 800 port, but it simply won't register. I bought a cable online that goes from my Sony (iLink) to the Firewire 800 port, so connecivity should be sound - but

  • White screen of death after 3 mins of usage

    Hiyah, so my iphone got the so called "White screen of death" after 3 minutes of usage, i've tried restore and all of that but without success. What should i do? Send it in for repair? (seems really ridicilous if have to since it was bought the same

  • MSS Object and data provider Important

    Dear All,          I have a requirement of changing the list of data that is displaying on the general information of the Manager iview. The manager should look the Org unit till depth 3. But we have a standard rule for setting it till org unit 2(MSS