how to get current date time in android

Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String strDate = sdf.format(c.getTime());
Log.d("Date","DATE : " + strDate)

0
3
A-312 69370 points

                                    import java.time.*;
LocalDateTime datetime = LocalDateTime.now(); 

0
0
4
5
Krish 100200 points

                                    String currentDateTimeString = java.text.DateFormat.getDateTimeInstance().format(new Date());

// textView is the TextView view that should display it
textView.setText(currentDateTimeString);

4 (5 Votes)
0
0
0
Phoenix Logan 186120 points

                                      SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyy_HHmmss", Locale.getDefault());
                String currentDateandTime = sdf.format(new Date());
                System.out.println("currentDateandTime" + currentDateandTime);

0
0
4.13
8
A-312 69370 points

                                    import java.util.Calendar

Date currentTime = Calendar.getInstance().getTime();

4.13 (8 Votes)
0
3.67
6
Awgiedawgie 440215 points

                                    import java.time.*;
LocalDate date = LocalDate.now();

3.67 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
android current time how to get current date timestamp in android studio calendar get current date android get current time in android studio show the current date in android get date and time in android get date and time in android studio display current time based on location android java get current date in android studio just get the current date android best way to get current time in java android get current date time string java android get todays date android how to get current date and time in android java how to set current date in android studio get current date android code get time today android java android studio get date and time android get system date get actual date java android get today's date with Date in android get date from Date in android get current time library android get current time in android how to get system date in android studio how to get todays date in android get current date and time in android how to get current date in android studio java how to get today date in android how to get date in android how to get the current date in andoid currnt date in android how get current time in android how to get datein android how to get the current date in android studio get current time in android java get current datetime android Datetime now android get current time android get time android get system date and time in android get current date android studio get current datetime by location android studio get current datetime of city android studio get only time java android android get date get today date in android java android current date how to get current time android get date now android android studio get current time get current time in java android set current date android android get now time android studio get date how to get date in android studio how to get current date in calendar in java android how to get current date in java android android get date from user display current date and time android studio android date get current date android getDate android studio getting current date and time android studio getting current date and time android studio getting current date android today date android get actual time get todays date and time in android? android studio get current date time Current Time in android how to get today date android java date of today android java calendar current date java android how to get current date and time in android android get todays date android get current date and time java how to get current time in android with java get date android get current date in java android Android library get current date and time android studio get time and date get date java android android date now how to get current date android current date android android studio get date now how to get the current date in android get actual current time android android get system time current date android studio android calendar get current time current time android android how to get the current date and time in java get current date and time android show current date android studio android get local time display current date in android studio current date in android android get time get current time hour android how to get current date and time in android studio android get exact current time android java get exact current time android java get exact time how to get system current time in android studio how to get current date and time in android programmatically how to get the date in android studio android studio current Date android system get current date time get actual date android get datetime android android date get now how to get current time and date in android get today's date java android studio android studio get current date and time current date in android studio android studio get today date get time date in android how to get date time in android how to get current time in android studio get today date in android how to get todays date in android studio get current date in android java android get current date get current date in android get date android studio how to get current date time in android how to get current date in android system.current time android get today date android how to get current time in android java android get current time android how to get system time get system time android android 7 get date java android studio get current date get current time android java android studio get current system time how to get todays date android get current date time android Java android current date time java get current time java android get current date android getting currenttime android how to get exact date and time java android studio how to get current date in android studio how to get only current date in android get date from calendar android get current time android get time android java java get current time how to get current system date only in android get current time in jaava java calendar today How to get current date and time android studio java java android get current time in seconds android get current time date android stack overflow android java get date time android java date time android java get current date android java get current date time android java get current time
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source