android程序如果需要全屏或者去掉标题栏,则可以在oncreate开始处,在未处理layout前加上:

protected void onCreate(Bundle savedInstanceState) {

  //不显示标题栏
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  //全屏,不显示信息栏
  //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN ,
  //              WindowManager.LayoutParams.FLAG_FULLSCREEN);

  super.onCreate(savedInstanceState);
  ....


今天处理了时间戳的问题,sqlite里面没有自动更新的timestamp字段,需要自己更新:

private void updateArticle(long aId) {
  //取得时间戳
  long timestamp = System.currentTimeMillis()/1000;
  String sql = "update aslibra_article set lastTime='"+timestamp+"' where aId = "+aId;
  mDb.execSQL(sql);
}


另外一个不同语言的时间戳的方法

引用
To Get Unix timestamp value in seconds

java:

long timestamp = System.currentTimeMillis()/1000

Python:

import time
timestamp = int(time.time())

Erlang:

{Mega, Secs, _} = now(),
Timestamp = Mega*1000000 + Secs,

Working with timestamps in MySQL

mysql> SELECT UNIX_TIMESTAMP('1997-10-04 22:23:00');
-> 875996580
mysql> SELECT FROM_UNIXTIME(1111885200);
+---------------------------+
| FROM_UNIXTIME(1111885200) |
+---------------------------+
| 2005-03-27 03:00:00 |
+---------------------------+



原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
Tags:
发表评论
表情
emotemotemotemotemotemotemotemotemotemotemotemotemot
emotemotemotemotemotemotemotemotemotemotemotemot
打开HTML 打开UBB 打开表情 隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写
 

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐