[TxMt] plist and the Ruby date object

Brett Terpstra brett at circlesixdesign.com
Thu Nov 16 01:21:47 UTC 2006


So, if 185328000 is a cocoa representation of the current date, how  
do I get the time added in there?  I honestly tried to figure this  
out and am stuck again...

I kind of understand this part:

def to_cocoa_date(date)
   ((date - Date.new(2001, 1, 1)+1)* 3600 * 24).to_i
end

date = Date.today

But I don't know what formula to run on Time.now to get the same result.

Thanks,
Brett

On Nov 15, 2006, at 5:38 PM, Charilaos Skiadas wrote:

> On Nov 15, 2006, at 6:05 PM, Brett Terpstra wrote:
>
>> I'm working on a Backpack bundle and I've hit a stumbling block.   
>> I can't get a date object into a plist.  I need to read it into a  
>> nib to set the date on a datepicker to the current date and time,  
>> but I can't get any of the functions in the plist library to  
>> recognize it.  Any idea what I'm doing wrong?  I'd post code, but  
>> I've tried so many things it's hard to begin to describe it...  I  
>> could just be slow.
>>
> Have a look at the GTDAlt bundle's date picker (The command is  
> called Set Date if I recall correctly).
>
>> Thanks,
>> Brett
>
> Haris
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate

Brett Terpstra : Art Director
Circle Six Design, Inc.
111 Riverfront Dr, Suite 204
..................................................
p: 507.459.4398
     877.858.4332
f: 1.866.540.3063
e: brett at circlesixdesign.com
http://www.circlesixdesign.com
..................................................





More information about the textmate mailing list