Convert dateTime to unix epoch in xslt

前端 未结 3 878
余生分开走
余生分开走 2020-12-31 10:37

I have a dateTime variable, and I want to convert it to a decimal value of epoch. How can this be done?

I tried using:

seconds-from-duration($time, x         


        
3条回答
  •  情歌与酒
    2020-12-31 10:54

    A pure xsl 1.0 lib example:

    
    
        
        
            
            time_as_timestamp:
    
            
                
                    
                
            
            time_as_xsdatetime:
    
            converted back:
            
                
            
        
    
    

    Output:

    time_as_timestamp:1365599995640
    time_as_xsdatetime:2013-04-10T13:19:55.640Z
    converted back:1365599995640

提交回复
热议问题