Ok, i've resolved the mistery... And if anyone is wondering, here's how it 
works.

The date is a simple Long value containing the milliseconds.

It is encoded in something that looks like base64, but using this 
characters:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$_

Where:

A = 0
B = 1
_ = 63
BA = 64
P__________ = -1
P_________$ = -2

So, my code to convert it back to a long ended up like this:

const gwtLongChars = 
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$_"

func ToLong(v string) (int64, os.Error) {
var t int64 = 0
 for i := 0; i < len(v); i++ {
c := v[i:i+1]
idx := strings.Index(gwtLongChars, c)
if idx < 0 {
return 0, os.NewError(fmt.Sprintf("Not long GWT, found: %s", c))
}
 t = t * 64 + int64(idx)
}
 return t, nil
}

Hope it's helpful for someone else.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/etV_oYxeMI0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to