Skip to content Skip to sidebar Skip to footer

Date And Time Format

Greeting! I've done a project that can send GPS Coordinates to mobile number Automatically, The Recipients received like this example format 'lat:14.7836139 long:12.71104 speed:0.0

Solution 1:

Being a development question, this should be moved to StackOverflow, but here's a tip: DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(loc.getTime()));

See the official documentation on the relevant classes around here to tweak it to suit your needs.

Solution 2:

SimpleDateFormat should do the trick, you can then set the format mask yourself. Alternatively you could use the android Time class, but that is a bit more tricky mask wise.

SimpleDateFormatdateTimeFormat=newSimpleDateFormat("dd/MM/yy HH:mm");
dateTimeFormat.format(newDate(loc.getTime()));

Post a Comment for "Date And Time Format"