This week's book giveaways are in the Jython/Python and Object-Oriented programming forums. We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line! See this thread and this one for details.
i need a unique string that i can assign to filenames. so, i'm trying to use the Date() class for this. *** code fragment *** Date what=new Date(); String thisMoment=String.valueOf(what); ***************** this returns: Wed Mar 14 16:44:44 PST 2001 how do i get the milisecond portion of this. more generally, i guess this becomes a question of how to read the following javadoc. *** from Java Documentation *** Date public Date(long date) Allocates a Date object and initializes it to represent the specified number of milliseconds since January 1, 1970, 00:00:00 GMT. Parameters: date - the milliseconds since January 1, 1970, 00:00:00 GMT. **************** thanks in advance. jay
Hi Jay! You may be looking at old documentation. I checked out the documentation at the same link Cindy posted, and in addition to the documentation you posted above, there was a "See Also" section that pointed to System.currentTimeMillis(). Of course, it's just a ton of information to absorb, so I'm sure it just takes some time working with the classes.
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.