Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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)
Comment

android java get current date

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

how to get current date time in android

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

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

android java get current time

import java.time.*;
LocalTime time = LocalTime.now(); 
Comment

android java get current time

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

Get time android

Calendar c = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss a");
        String strDate = sdf.format(c.getTime());
        Log.d("TAG","DATE : " + strDate);
Comment

how to get current date time in android

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

how to get current date time in android

import java.util.Calendar

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

How to get current time and date in Android

import java.util.Calendar  Date currentTime = Calendar.getInstance().getTime();
Comment

PREVIOUS NEXT
Code Example
Java :: delete ending part of the string java 
Java :: This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.1 or newer. 
Java :: how to calculate exponential in java 
Java :: inline arraylist initialization java 
Java :: insert data into list java 
Java :: how to read file from assets folder in android 
Java :: byte array to base64 string 
Java :: java iterate over list 
Java :: share intent android 
Java :: flutter remove last caracter from string 
Java :: java variables in annotations 
Java :: how to do the maximum of three numbers in java 
Java :: jacoco code coverage 
Java :: java make all interfaces implement another 
Java :: split string into int array 
Java :: view binding in recyclerview adapter android java 
Java :: math library java 
Java :: Java, how to compare Strings with String Arrays 
Java :: 12 hours to 24 hours java 
Java :: android list[i] 
Java :: java how to get all threads 
Java :: string reverse in java 
Java :: java exception message 
Java :: permutation array java 
Java :: java int 
Java :: how to create an action listener in java 
Java :: pivot in array 
Java :: intent pick action video android 
Java :: terminate a frame java 
Java :: List into string java 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =