为什么爪哇(Android的?)我的文件的最后修改日期设置为明天? [英] Why is Java (Android?) setting my file's last modified date to tomorrow?

查看:216
本文介绍了为什么爪哇(Android的?)我的文件的最后修改日期设置为明天?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Andr​​oid应用程序中使用创建文件:

I'm creating files in my Android application using:

FileOutputStream fos = context.openFileOutput(fileName, Context.MODE_PRIVATE);
fos.write(data);
fos.flush();
fos.close();

再后来我试图做一些清理工作,所以我比较最后修改日期为某些阈值,但比较是显示该文件的最后修改日期是明天的某个时候。请记住,当我说,明天,也就是相对于今日(该文件的修改日期)为准......这一天可能你正在读这篇文章。

Then later I'm trying to do some cleanup, so I'm comparing the last modified date to some threshold value, but the comparison is showing that the file's last modified date is tomorrow sometime. Keep in mind, when I say tomorrow, that is relative to today (the file modification date)... whichever day this may be that you're reading this.

所以基本上,如果我创建文件的今天,并检查文件的最后修改日期,它说,这是最后一次修改的明天。

So basically, if I create the file today, and check the file's last modification date, it says it was last modified tomorrow.

这是Java的东西是干什么的,或Android,或者说我在干什么?

Is this something Java is doing, or Android, or something I'm doing?

推荐答案

什么是您的测试设备/仿真器显示当前日期和时间?听起来好像他们只是设置不正确。

What does your test device/emulator show the current date and time as? It sounds like they're just set incorrectly.

设置为比你本地时间比如其他一些设备上的时区?

Is the time zone on the device set to something other than your local time for instance?

这篇关于为什么爪哇(Android的?)我的文件的最后修改日期设置为明天?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆