All Questions
Tagged with unix-timestamp android
60
questions
-1
votes
2
answers
2k
views
How to get today's timestamp in GMT format - Kotlin
I am using below function to fetch the today's start Timestamp in kotlin- Android.
fun getTimeStampForStartOfTheDay(): String {
val localDate = LocalDate.now() // your current date time
val ...
-1
votes
3
answers
1k
views
How can I get Unix Timestamp automatically for every next day?
I need to generate Unix timestamp in milliseconds for every next day at a definite time.
For example:
today is 4/11/2021 at 09:00:00 then timestamp is: 1636002000000
for tomorrow I need 5/11/2021 at ...
0
votes
1
answer
395
views
How to convert epoch timestamp to unix hex timestamp in kotlin?
I am using the following code to get the current epoch time in kotlin.
val epochTime = Instant.now().toEpochMilli()
Output: 1628769521313
And now the question is how can I convert this timestamp to ...
0
votes
2
answers
152
views
Unix TimeStamp value gets Corrupted
I'm trying to fetch Unix Timestamp value using below snippet but sometimes the value get corrupted like 11030 or 810 something like random number we don,t get actual date
public static int ...
1
vote
1
answer
6k
views
Conversion of date and time to unix timestamp - kotlin
In timestamp variable, I want to get the timestampt value with the current hour, minute and second. The currentDataTime gives me the time in this format: 2020-08-28 17:18:02.
Currently, the timestamp ...
0
votes
2
answers
662
views
Converted unix timestamp with a timezone addition in seconds gives a true local date time on Android emulator but not in real device?
I took a date from a web service in UNIX timestamp. I milltuplied it by 1000L then I added the timezone to it in seconds (also provided by the web service) milltiplied by 1000 to obtain the date ...
0
votes
1
answer
2k
views
Sunrise and sunset time are equal after converting
I am trying to convert the millisecond format of time provided by openweathermap but when I convert them the times are just 1minute apart.
I have tried converting using Simpledateformat.
fun ...
-2
votes
1
answer
2k
views
Why is Android System.currentTimeMillis() not an accurate Timestamp? [duplicate]
I've encountered what appears to be a very unusual bug while developing an android application.
The following code in my MainActivity onCreate method:
long ts = System.currentTimeMillis();
System....
0
votes
2
answers
1k
views
Calendar.setTimeInMillis error - why is that? [duplicate]
calendar gets wrong unix time as I got.
long millis = 1568814839L;
System.out.println(millis); //1568814839
Calendar.getInstance(TimeZone.getTimeZone("Asia/Tashkent"));
calendar.setTimeInMillis(...
0
votes
0
answers
86
views
Unix time -> string using C on mobile (Android/iOS)
Given a Unix time, as number of seconds since Jan 1st, 1970, how can I convert that to a human-readable string (say, ISO-8601) using C on Android and iOS? The standard library's time.h implementation ...
1
vote
2
answers
2k
views
How get accurate UTC timestamp in android
I do not know which one is right for get UTC time
My code is
System.currentTimeMillis()
for java android
Is the result correct for international?
Maybe user can change device time and result be ...
-1
votes
1
answer
264
views
Issue: Set Alarm Based on UnixTimestamp
I am trying to set the alarm based on UnixTimestamp, but always the application send alarm before the time i set it , e.g i set alarm on 1563551362 , now the problem is i received the alarm not on ...
0
votes
1
answer
605
views
calendar timeinmillis returns wrong value
With a DatePicker I choose a Date and I need the date and the timestamp
from the chosen date:
Calendar calendar = Calendar.getInstance(Locale.GERMANY);
final DatePickerDialog....
0
votes
4
answers
1k
views
Get unix timestamp exactly 3 years from now
Using Android and Java 8, how can I get unix timestamps back in time?
E.g.
Exactly 3 years back from now
Exactly 2 months back from now
Exactly 1 day back from now
etc
I know I can get current ...
0
votes
3
answers
3k
views
How to find difference between two UNIX time stamp in hours in KOTLIN?
I have two UNIX time stamp and i am using KOTLIN
1) old time - 1534854646
2) current time - 1534857527
Now i want the difference in hours and minutes.
val result = DateUtils....