Date: Mon, 14 Nov 2011 01:54:49 -0800
Reply-To: David Marso <david.marso@gmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: David Marso <david.marso@gmail.com>
Subject: Re: date problem
In-Reply-To: <1321262310520-4990196.post@n5.nabble.com>
Content-Type: text/plain; charset=us-ascii
Two approaches:
data list /x (A19).
BEGIN DATA
2007-03-17 13:00:00
end data.
COMPUTE
DATEX=NUMBER(CONCAT(SUBSTR(X,9,2),SUBSTR(X,5,4),SUBSTR(X,1,4),SUBSTR(X,11)),DATETIME).
FORMAT DATEX (DATETIME).
list.
data list /D (SDATE) T (TIME).
BEGIN DATA
2007-03-17 13:00:00
end data.
COMPUTE DT=D+T.
FORMAT DT (DATETIME).
list.
HTH, David
--
drfg2008 wrote:
>
> SPSS20 / Win
>
> I have a csv-file with the following date format:
>
> 2007-03-17 13:00:00
>
>
> I couldn't find a way to import it in SPSS as a date format (either while
> importing it from csv or as a function after being imported as a string,
> or any other solution)
>
> Thanks for some help
>
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/date-problem-tp4990196p4990278.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|