由买买提看人间百态

topics

全部话题 - 话题: dateformat
(共0页)
l**s
发帖数: 28
1
来自主题: Java版 - parse Date in DateFormat
thanks.
DateFormat should handle DST, it has a TimeZone with it.
I think the problem will be either DateFormat.format() returns wrong string
or DateFormat.parse() returns wrong date, It might be a Java bug,since
it only happens in Australia TimeZones.
m******t
发帖数: 2416
2
来自主题: Java版 - parse Date in DateFormat

I'm not sure DateFormat handles daylight saving times.
You might want to look into Calendar, and more specifically,
GregorianCalendar. The javadoc of GregorianCalendar has some interesting
discussion and example on how to handle the daylight saving time offset.
c*******e
发帖数: 290
3
来自主题: Java版 - ThreadLocal 的一个 use case
对,因为那个 date 是个 local variable, 每次都重新创建。所以,他那个例子完全
不适合,根本就用不上 ThreadLocal, 他那个 PerThreadFormatter 完全是多余的. 贴
出他的完整例子:
/**
*
* @author
*/
public class ThreadLocalTest {
public static void main(String args[]) throws IOException {
Thread t1 = new Thread(new Task());
Thread t2 = new Thread( new Task());

t1.start();
t2.start();

}

/*
* Thread safe format method because every thread will use its own
DateFormat
*/
public static S... 阅读全帖
F****n
发帖数: 3271
4
来自主题: Java版 - DATE TIME In RDBMS
IMO, those RDBMS people constantly cannot understand the difference between
a date and a dateformat. Those people always try to legitimate their
implementation by spending several pages talking about Date Format. In fact
for date / time storage you only need a integer / long, and the complexity
of DateFormat can always be encapsulated in the JDBC driver (or other DB
access API).
o******l
发帖数: 4385
b****i
发帖数: 805
6
来自主题: WashingtonDC版 - 本月25-27号去DC游玩,请推荐宾馆
价格不错,就是交通不太方便。多谢了。

sid=7pAHg._fmotgV76g.12&sarea=&sname=&sstate=&scountry=&sradius=&slat=&slo
n=&schain=&exp=&scity=&sort=&type=&map=&srp=RACK&amenity=&sstate_country=&
city_code=&dateFormat=mm/dd/yy&arrivalDate=06/25/10&departureDate=06/27/10
&nroom=1&nadult1=1&nchild1=0&nadult2=&nchild2=&nadult3=&nchild3=&nadult4=&
nchild4=&nadult5=&nchild5=
y****w
发帖数: 3747
7
来自主题: Database版 - date format转换问题请教
SET DATEFORMAT
google "sql server bcp date format"
m******t
发帖数: 2416
8
来自主题: Java版 - 问个java里得到时间的问题

Using java.text.DateFormat would relieve you from hassles like this,
man.
d*r
发帖数: 238
9
来自主题: Java版 - HELP! Question about Calendar
Met a strange question:
I tried to set a date and output it:
Calendar c = new GregorianCalendar(2003, 12, 1); // set the calendar to
12/1/2003
System.out.println(DateFormat.getDateInstance().format(c)); // output
The output is Jan 1, 2004.
Who knows what's the problem?
I am using java 1.4.1
l**s
发帖数: 28
10
来自主题: Java版 - parse Date in DateFormat
the following code generates the result as:
Current TimeZone:America/New_York
before parse:2003-11-15 16:42:05 EST
after parse:2003-11-15 16:42:05 EST
Timezone change to:Australia/Sydney
before parse:2003-11-16 08:42:05 EST
after parse:2003-11-16 09:42:05 EST
it had 1 hour different in Australia/Sydney timezone(called EST too) before
and after the parsing.
could someone please tell me why?
Thanks.
=================================================================
import java.util.TimeZone;
impo
l**s
发帖数: 28
11
来自主题: Java版 - parse Date in DateFormat
BTW, the problem happens only in the Australia TimeZones
Australia/Adelaide
Australia/Broken_Hill
Australia/South
Australia/Yancowinna
AET
Australia/ACT
Australia/Canberra
Australia/Hobart
Australia/Melbourne
Australia/NSW
Australia/Sydney
Australia/Tasmania
Australia/Victoria
right now it's summer there and they use DayLightSaving time, so it might be
somewhere messed up when handling the DST in Australia.
l**s
发帖数: 28
12
来自主题: Java版 - parse Date in DateFormat
Australia starts DST on the last Sunday in October
the parse works fine if in standard time(non-DST) in Australia timezone
B**z
发帖数: 153
13
来自主题: Java版 - parse Date in DateFormat
see Java bug database bug ID # 4856901, status:in progress
last updated on 2003-11-06.
m******t
发帖数: 2416
14

JAVA

StringTokenizer probably isn't the best way. Use java.text.DateFormat to parse
the whole string into a date.
g******i
发帖数: 32
15
不太明白,这个DateFormat 需要怎样和文件流结合起来用呢?
另外,JAVA是否有方式(比如不用StringTokenizer)可以象C++读文件一样只将空白符做为
分隔符而不考虑其他任何特殊字符呢?

parse
u****s
发帖数: 2186
16
来自主题: Java版 - Java练习题 5
some of them are real questions asked in tests or interviews.
question 1. is to solve a SQLSever 2005 bug, it won't parse UTC dateformat
for non-English locale, the bug is fixed in SQLServer 2008.
c*******e
发帖数: 290
17
来自主题: Java版 - ThreadLocal 的一个 use case
这个没有任何 thread safety 的保护,但好像是安全的。为什么?
public class ThreadLocalTest {
public static void main(String args[]) throws IOException {
Thread t1 = new Thread(new Task());
Thread t2 = new Thread( new Task());

t1.start();
t2.start();

}

public static String threadSafeFormat(Date date){
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
return formatter.format(date);
}

}
class Task implements Runnable{

@Ov... 阅读全帖
a********i
发帖数: 205
18
你直接用proc sql调用这个表的话就input(varibale,dateformat,)
如果用infile建立dataset就在input后面加informat就行了
a********i
发帖数: 205
19

那你是用proc import导入的
前面两种方法就不是了
那你直接用
data a;
set a;
var=input(var,dateformat,);
run;
这样应该可以
(共0页)