本文整理汇总了Python中java.util.Calendar.getTime方法的典型用法代码示例。如果您正苦于以下问题:Python Calendar.getTime方法的具体用法?Python Calendar.getTime怎么用?Python Calendar.getTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Calendar
的用法示例。
在下文中一共展示了Calendar.getTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from java.util import Calendar [as 别名]
# 或者: from java.util.Calendar import getTime [as 别名]
def __init__(self):
dataDir = Settings.dataDir + 'ProgrammingEmail/CustomizeEmailHeaders/'
# Create a instance of MailMessage class
message = MailMessage()
# Set subject of the message
message.setSubject("New message created by Aspose.Email for Java")
# Set Html body
message.setHtmlBody("<b>This line is in bold.</b> <br/> <br/>" +
"<font color=blue>This line is in blue color</font>")
# Set sender information
message.setFrom(MailAddress("[email protected]", "Sender Name", False))
# Add TO recipients
message.getTo().add(MailAddress("[email protected]", "Recipient 1", False))
# Message subject
message.setSubject("Customizing Email Headers")
# Specify Date
timeZone=TimeZone()
calendar=Calendar()
calendar = calendar.getInstance(timeZone.getTimeZone("GMT"))
date = calendar.getTime()
message.setDate(date)
# Specify XMailer
message.setXMailer("Aspose.Email")
# Specify Secret Header
message.getHeaders().add("secret-header", "mystery")
# Save message to disc
messageFormat=MessageFormat()
message.save(dataDir + "MsgHeaders.msg", messageFormat.getMsg())
# Display Status
print "Customized message headers Successfully."