#! /usr/bin/python # encoding: UTF-8 import os,sys import time import wx import locale locale.setlocale(locale.LC_TIME, "ja") #deffmt="%a %b %e %H:%M:%S %Z %Y" deffmt="%Y/%m/%d(%a) %H:%M" class date2clip: def __init__(self, args): global deffmt if len(args)==0: fmt=deffmt else: fmt=" ".join(args) self.tmstr=time.strftime(fmt, time.localtime()) def toclip(self): clp=wx.Clipboard() clp.SetData(wx.TextDataObject(self.tmstr)) clp.Flush() dc=date2clip(sys.argv[1:]) dc.toclip()