formatMsgTime (timespan) { var dateTime = new Date(timespan); var year = dateTime.getFullYear(); var month = dateTime.getMonth() + 1; var day = dateTime.getDate(); var hour = dateTime.getHours(); var minute = dateTime.getMinutes(); var second = dateT
之前自己一直手工编写函数来实现dip值到px值,今天无意中发现android本身就带有类似的函数来实现这种转换过程,就是 TypedValue.applyDimension public class TypedValueApiUseDemoActivity extends AppCompatActivity { public static final String TAG = "xp.chen"; @Override protected void onCreate(Bundle sav
TimeNow: function (val) { var date = new Date(val); var Y = date.getFullYear(); var m = date.getMonth() + 1; var d = date.getDate(); var H = date.getHours(); var i = date.getMinutes(); var s = date.getSeconds(); if (m < 10) m = '0' + m; if (d < 10)