惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
爱范儿
爱范儿
Y
Y Combinator Blog
T
Tor Project blog
V
Visual Studio Blog
U
Unit 42
B
Blog RSS Feed
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
G
Google Developers Blog
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
Microsoft Azure Blog
Microsoft Azure Blog
T
The Blog of Author Tim Ferriss
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
博客园_首页
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
P
Proofpoint News Feed
Jina AI
Jina AI
博客园 - 【当耐特】
S
Security @ Cisco Blogs
I
Intezer
MyScale Blog
MyScale Blog
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
腾讯CDC
T
Tenable Blog
A
Arctic Wolf
T
Threat Research - Cisco Blogs
S
Securelist
Know Your Adversary
Know Your Adversary
Spread Privacy
Spread Privacy
C
Check Point Blog
NISL@THU
NISL@THU
Microsoft Security Blog
Microsoft Security Blog
V
Vulnerabilities – Threatpost

博客园 - waya

解決MySQL中文亂碼 java的圖像縮略方法 攝影用光 Flex調試工具Flextracepanel linux下安裝JDK5 Installing Flex Data Services on JBoss 得到不同時區的當前時間 - waya - 博客园 Flex實現的一些小應用,截幾個界面圖留驗 一個便宜的高负载网站架构 同時啟動多個Tomcat服務器 - waya - 博客园 在同一臺機器上同時啟動多個JBOSS spring2與spring1的單例模式的配置區別 Flex的多行表頭 Trace到文件的設置 開啟整屏窗口並無痕關閉父窗口 隱藏顯示表格行;確認提示窗口;開啟定制窗口 Log4j日志异步写入數據庫 參數URL編碼 URL编码表一览
時間字符串轉換
waya · 2006-12-13 · via 博客园 - waya

try
     

      String st
="2005-13-32 12:00";
     java.text.DateFormat df 
= new SimpleDateFormat("yyyy-MM-dd hh:mm");
              Date  starttime 
= df.parse(st);
     System.out.println(starttime.toString());        
     }
 
catch(Exception ex)
{
 
}

try {
   String st 
= "2005-12-2 12:00:00";
   Timestamp starttime 
= Timestamp.valueOf(st);
   System.out.println(starttime.toString());
  }
 catch (Exception ex) {
   ex.printStackTrace();
  }

import java.sql.*;
import java.util.*;
public class CreateTimestamp {
   
public static void main(String [] args) {
   Calendar cal 
= Calendar.getInstance();
   cal.set(Calendar.YEAR, 
2000);
   cal.set(Calendar.MONTH, Calendar.JANUARY);
   cal.set(Calendar.DATE, 
1);
   cal.set(Calendar.HOUR_OF_DAY, 
11);
   cal.set(Calendar.MINUTE, 
45);
   cal.set(Calendar.SECOND, 
30);
   cal.set(Calendar.MILLISECOND, 
0);
   
long millis = cal.getTime().getTime();
   System.out.println(
"milliseconds in millis = " + millis);
   java.sql.Timestamp ts 
= new java.sql.Timestamp(millis);
   System.out.println(
"Timestamp ts before setting nanos = " + ts);
   ts.setNanos(
500);
   System.out.println(
"Timestamp ts with nanos set = " + ts);
   }

}