@staticmethod<EOL><INDENT>def from_datetime(dt, machine_id=<NUM_LIT:0>):<DEDENT>
td = dt - Timestamp._EPOCH<EOL>seconds = td.days * <NUM_LIT> * <NUM_LIT><EOL>seconds += td.seconds<EOL>return Timestamp(seconds, td.microseconds*<NUM_LIT:1000>, machine_id)<EOL>
Convert a datetime to an SPL `Timestamp`.

Args:
   dt(datetime.datetime): Datetime to be converted.
   machine_id(int): Machine identifier.

Returns:
     Timestamp: Datetime converted to Timestamp.