flunker kid
System Time
1 Answer(s)      4 years and 7 months ago
Posted in : Java Beginners

how do i store the system time in a variable in BlueJ ???????

Advertisement
View Answers

November 13, 2010 at 10:56 AM


Hi Friend,

Here is your required code:

import java.util.*;
import java.text.*;
class StoreSystemTime {
    public static void main(String[] args){
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    long time = System.currentTimeMillis();
    Date date = new Date(time);
    String datestring = dateFormat.format(date);
    System.out.println(datestring);
    }
}

Thanks










Related Tutorials/Questions & Answers:
System Time
System Time  how do i store the system time in a variable in BlueJ
Oracle Database - Insert System Time
Oracle Database - Insert System Time  Hi I want to insert only system time dynamically using a statement but not a prepared statement into Oracle Database please suggest me any code
Advertisements
Display current time & system properties using JSP expressions
Display current time & system properties using JSP expressions In this Section ,we will display current time and system properties using JSP... on system. <%= System.getProperty("user.dir")%>
What is RTLS or Real Time Location System?
RTLS or Real Time Location System is a positioning system that acquired new... for incorporating many other features. RTLS or Real Time Positioning System compared... tracking system is an active real time based solution that can use radio frequency
time
time  how to find the current system time between the user login and logout using java
System
System  What is System in System.out.println() method? Is it a Class or a Package
time
time  sir, i want to show system time on a textfield in awt(java). woulk you send me an example of time which can show time in standard format like H:M:S pls help me sir   Display time in JTextField import
Getting the Current Time
Getting the Current Time       This section shows the way of getting  the current time of the system. In this section, through the given program you can get the current
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time display only as hh:mm.  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database
time
time format hh:mm:ss  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
time
retrieved time from mysql database  Hi. I have retrieved time from.... wat to do?   Here is a jsp example that fetch the time from... is a jsp example that fetch the time from the database and display in different
Java get System TimeZone
want to display the System's Time zone.For this we consider a class... Java get System TimeZone       In this section, you will learn how to obtain the System's
Mysql Time Only
Mysql Time Only       Mysql Time Only is used to return the current time on your current local system... and time. The below Query now( ) return you the current date and time  as field
What is Vehicle Security System?
monitoring System allows a party to locate, trace and monitor its vehicles in real time...A Vehicle security system is a system that combines the Internet technology.... This security system helps in finding out the location of a vehicle using different methods
Date & Time
Date & Time  How to insert System Date & Time in MS-ACCESS using Java
Date & Time
Date & Time  How to insert System Date & Time in MS-ACCESS using Java
time ()
PHP time() Function The time() returns the current time  measured...;). Syntax of time() Function in PHP time(void) Parameter of time() Function in PHP void - void is optional parameter.  Example of time
c++ system command
c++ system command   c++ system command variables and an example in real time of using the system command
About Vehicle Tracking System
tracking system is an important utility for tracking vehicles at a given point in time...About Vehicle Tracking System About VEHICLE TRACKING SYSTEM is the technology... different methods. A vehicle tracking system has certain components extremely
Vehicle Monitoring System
Vehicle Monitoring System A Vehicle monitoring system is a system used... an electronic web based system that uses modern technology embedded... the vehicle's location. Vehicle monitoring System allows a party to track, trace
Global Positioning System
Global Positioning System       Brief History :-The Global positioning System (GPS), formally known as the Navstar Global Positioning System, was first time used by united states