Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
return year month from datetime

        def get_ym_from_datetime(a_datetime):
    """
       return year month from datetime
    """
    if a_datetime:
        return a_datetime.strftime('%Y-%m')
    
    return None
        


src/g/m/gmvault-HEAD/src/gmv/gmvault.py   gmvault(Download)
 
                    if a_type == "email":
                        the_dir = gmvault_utils.get_ym_from_datetime(eml_date)
                    elif a_type == "chat":
                        the_dir = self.gstorer.get_sub_chats_dir()

src/g/m/gmvault-HEAD/src/sandbox/common_gmvault.py   gmvault(Download)
                    gid = new_data[the_id][imap_utils.GIMAPFetcher.GMAIL_ID]
 
                    the_dir      = gmvault_utils.get_ym_from_datetime(new_data[the_id][imap_utils.GIMAPFetcher.IMAP_INTERNALDATE])
 
                    LOG.critical("Process email num %d (imap_id:%s) from %s." % (nb_emails_processed, the_id, the_dir))

src/g/m/gmvault-1.8.1-beta/src/gmv/gmvault.py   gmvault(Download)
 
                    if a_type == "email":
                        the_dir = gmvault_utils.get_ym_from_datetime(eml_date)
                    elif a_type == "chat":
                        the_dir = self.gstorer.get_sub_chats_dir()

src/g/m/gmvault-HEAD/src/gmv/gmv_cmd.py   gmvault(Download)
            begin = today - datetime.timedelta(gmvault_utils.get_conf_defaults().getint("Restore", "quick_days", 8))
 
            starting_dir = gmvault_utils.get_ym_from_datetime(begin)
 
            #call restore

src/g/m/gmvault-1.8.1-beta/src/gmv/gmv_cmd.py   gmvault(Download)
            begin = today - datetime.timedelta(gmvault_utils.get_conf_defaults().getint("Restore", "quick_days", 8))
 
            starting_dir = gmvault_utils.get_ym_from_datetime(begin)
 
            #call restore