Mpd widget time string format convert

I use mpd vicious widget and successfully added line to show time of current play in my awesome wm panel but it shows in seconds, for example 5:210 - my question is what lines of lua code I have to add to my rc.lua to show 00:05/03:30 ? thanks

I use mpd vicious widget and successfully added line to show time of current play in my awesome wm panel but it shows in seconds, for example 5:210 - my question is what lines of lua code I have to add to my rc.lua to show 00:05/03:30 ? thanks

Similar Messages

  • Time string format

    Bonjour,
    J'ai un data logger DT85 de Datataker qui me renvoit des Doubles dans Labview que j'insère dans un tableau et que j'index pour obtenir les valeurs. Le hic est que je recois également un temps relatif en format hh:mm:ss.sss que j'ai besoin d'extraire. Est-ce que quelqu'un peut m'indiquer comment faire pour extraire mon temps?
    Merci,
    Richard
    Solved!
    Go to Solution.

    Have a look at the attached VI.
    Machine Vision, Robotics, Embedded Systems, Surveillance
    www.movimed.com - Custom Imaging Solutions
    Attachments:
    Time String to Milliseconds.vi ‏11 KB

  • Convert a date in String format to a Date

    Hi,
    How can I convert a date in String format to a Date object?
    I have tried:
    import java.text.*;
    import java.io.*;
    import java.util.Date;
    import java.util.Locale;
    import java.sql.*;
    public class casa {
    public static Connection con = null;
    public static Statement s = null;
    public static String sql = null;
    public static String mydate = "01.01.2001";
    /** Creates a new instance of casa */
    public casa() {
    public static void main(String[] args) throws SQLException{
    try {
    DateFormat shortFormat = DateFormat.getDateInstance(DateFormat.SHORT);
    Date date = shortFormat.parse(mydate);
    //Open Database
    con = getConnection();
    s = con.createStatement();
    sql = "select date1 from table1 where date1 <= '"+date+"'";
    ResultSet rs = s.executeQuery(sql);
    while(rs.next()){
    String aba = rs.getString("datum");
    System.out.println("New Datum = "+aba);
    } catch (Exception ex ) {
    ex.printStackTrace();
    closeConnection(s, con);
    //Connection
    private static Connection getConnection() {
    Connection con = null;
    String user ="aouzi";
    String passe ="aouzi";
    String url = "jdbc:db2:EjbTest";
    try {
    //Datenbanktreiber laden
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    //Verbindung herstellen
    con = DriverManager.getConnection(url,user,passe);
    }catch(ClassNotFoundException e){
    } catch(SQLException e){}
    return con;
    //close Connection
    private static void closeConnection(Statement s, Connection con) {
    try {
    s.close();
    } catch (SQLException e) {}
    try {
    con.close();
    } catch (SQLException e) {}
    I'm getting the following errors:
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0180N
    The syntax of the representation of a date/time of day value as character sequence is false. .SQLSTATE=22007

    I'm pretty sure it won't understand what date.toString() returns. If you know what format the database understands, you do it like this:
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yy"); // e.g. 18-Apr-02
    String datestring = sdf.parse(date);
    and use that instead of date in your sql string. Some databases understands it if you do
    "to_date('18-Apr-02')"
    so you could include that in your sql string as well..
    You could also try to make it a java.sql.Date and hope your jdbc driver knows how to convert it to a string that the database understands if you don't know the format:
    con = getConnection();
    PreparedStatement ps = con.prepareStatement("select date1 from table1 where date1 <= ?");
    ps.setDate(new java.sql.Date(date.getTime()));
    ResultSet rs = s.executeQuery(sql);

  • Convert HH:mm:ss String format.

    Hi,
    I have a formula in webI to display Milliseconds to HH:mm:ss and is in String format.
    Is there a way to convert to date or number format?.
    Also, how to calculate average of Max and Min time?.
    Thanks,
    Jothi

    Hi Jyothi,
    To take a average time do following-
    1) Convert Min Time and Max Time into Seconds.
    MaxSec=ToNumber(Substr([MaxTime];1;2))*60*60+ToNumber(Substr([MaxTime];4;2))*60+ToNumber(Substr([MaxTime];7;2))
    MinSec=ToNumber(Substr([MinTime];1;2))*60*60+ToNumber(Substr([MinTime];4;2))*60+ToNumber(Substr([MinTime];7;2))
    2) calculate approximate Avg seconds-
    AvgSec=([MaxSec]+[MinSec])/2
    3) Convert AvgSec in to hh:mm:ss.
    AvgTime=Floor([AvgSec]/3600 )+":"+Floor(Mod([AvgSec];3600)/60)+":"+Mod(Mod([AvgSec];3600);60)
    Hope this help.
    Thanks,
    Anuj

  • Get Time Stamp will milli seconds from string time stamp format

    Hi Guys,
    I am trying to get the time stamp with milli seconds value from string format time data,
    Attached the snippet (Get milli seconds to Time stamp)I  tried.
    Attached Sub VI Convert string to time stamp
    When run,I am not getting the time string indicator with milli seconds value even though the format have <%2u> .
    please guide me on this.
     ..AND Finally i will be converting the date and time string output to time stamp data type
    Attachments:
    Convert_String_to_TimeStamp.vi ‏13 KB
    Get Milli seconds to Time stamp.png ‏25 KB

    You do realize you could have just used a single Scan From String to get the timestamp, right?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Get Timestamp.png ‏43 KB

  • How to convert a number in to a time string?

    I have calculated a time in minutes: 3.75. But I will show it as a time string: 3:45 or 00:03:45 or anything like this.
    Yes, I can convert it manually, but then I can not use it in a diagram. I have a formula that calculates times for a given diameter and I will show the values in a diagram. The x axis should show the diameter, and the y axis should show the time in a typical time format eg: mm:ss.
    How can I solve this?

    Hello
    I just wish to add that I am unable to say:
    Engineers made a good or a wrong choice.
    They made one choice.
    I don't know if they imagine the odd consequences of this choice.
    But what they did with their choice is coherent.
    At least, it is as long we don't enter the area of import foreign sheets.
    When they import from XL, they forgot to take care of an important info available in .xls files which describes the date_time used starting point. It's 1/1/1904 for .xls docs created on Mac but an other one for docs created under Windows. Given this omission, imported date_time values may be wrong.
    When they import from AppleWorks it is completely foolish.
    You american users are well treated but us, european ones are in the mud.
    When we import an AW6 spreadsheet containing dates on a machine whose setting is the standard in use here: date format dd/mm/yyyy
    if the OS is 10.4.x we get odd values (I'm no longer born)
    if the OS is 10.5.x, Numbers quits.
    Apple engineers responded to Apple France that they where unable to reproduce the behavior.
    Sure, they failed to set the system's date format to the described one.
    This remind me an old bug which they can't reproduce too.
    It striked French keyboards but the tested with american ones.
    Sometimes I'm afraid that they smoke too much the carpet in Cupertino's offices
    Yvan KOENIG (from FRANCE jeudi 19 juin 2008 14:19:45)

  • Problem converting U8 array to date-time string

    Hi All,
    How can I convert U8 array (time_t data type from C dll) to date time string?
    A dll function that I am calling has a structure of string, integer and time_t as one of the parameters. Instead of passing cluster, I pass an array of U8 of the size that the structure should be. All the members of the strcuture and parsed correctly except the date/time.
    Function Parameter:
    typedef struct {
    Int AlarmState ;
    Int AlarmGrade ;
    TCHAR AlarmMessage [100] ;
    time_t AlarmTimeStamp ;
    } WV_ALARM_INFO ;
    Total size = 4 + 4 + 100 + 4 = 112
    Using Call Library Function, I set the parameter type to Array of U8 and size 112.
    After the array is populated when the function is called, I have done the following to interpret date and time.
    1) Using Extract Zero Terminated String.VI I converted U8 array (of size 4) to string.
    2) Type casted string to integer (I32).
    3) Swap bytes
    4) Swap Words
    5) Format Date/Time String.
    Please see the attached screenshot for visual display of the above.
    Ideas on why the year is incorrect?
    Mimansa
    Attachments:
    Time.JPG ‏102 KB

    Hi Mimansa,
    Is it only the year that is incorrect? Also, where did you find that ABC\0 VI that you use 3 times? Did you make it or is it in a labview library somewhere?
    Thanks,
    Laura

  • Day of year bug - format date/time string and scan from string?

    I've noticed that the day of year returned by "Format Date/Time String.vi" starts with a value of 1 for Jan-1 while "Scan from String.vi" wants a 0 index.  Is this a bug or feature?  
    (I'm using Labview 2010 Service Pack 1)

    I think the best idea is to use seconds since for your arithmetic, because it is going to be the most consistent and robust solution. Knowing that a day has 86400 seconds is all that is needed and you won't run in possible inconsistencies with date time implementations caused by our anything but logic calender. I would hazard that the functionality of converting a timestamp into year and day of year and back is impossible to make consistent without sacrificing other possibly conflicting transformation in the Timestamp into String and Timestamp from String manipulations.
    "Seconds since" being the actual base unit in all LabVIEW timestamps, it is best to do any arithmetic on it in this base unit.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to check the current time with a Stored  time in string format

    Hi All
    I would like to compare the system time with an existing time values which is allready there in String format..
    i mean i would like to check if the SysTime is inbetween 6:30 and 14:00
    I accomplished this in Oracle ..
    Select 'Y' from dual where to_date(to_char(sysdate,'HH24:MI '),'HH24:MI') between to_date('06:30','HH24:MI') and to_date('14:00','HH24:MI')
    But instead of checking the DB each and every time , the perfomance would be better if we can do this in our java code..
    Could some one provide me with a code to accomplish the above scenario..
    Thanks in advance..,.,

    import java.util.Calendar;
    Calendar rightNow = Calendar.getInstance();  // gets the current date and time to millisec
    Calendar earlyTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 6).set(Calendar.MINUTE, 30);
    Calendar lateTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 8).set(Calendar.MINUTE, 0);
    if (rightNow.compareTo(earlyTime)> 0 && rightNow.compareTo(lateTime) < 0){
    // do something
    }Try this.

  • Converting time string to integer (****) in Labview 5.1

    So i'm very new to labview, learning as i go, but as the title says, i
    need to convert a time string to an ineger so that it can be placed in
    an integer array which will be compiled then writen to file at a
    specified end ( by user ) I just want 4 digits **** to indicate
    military time. And unfortuanly i'm stuck with labview 5.1. Any help would be greatly appreciated.

    I believe the diagram I have attached may have been possible in LV 5.1.
    Try to wire this up and see if it works.
    The icons may have changed a little between LV 5.1 and 6.1.
    Ben
    Message Edited by Ben on 10-15-2005 02:49 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Mitary Time.JPG ‏19 KB

  • How to convert BLOB data into string format.

    Hi,
    I have problem while converting blob data into string format.
    for example,
    Select dbms_lob.substr(c.shape.Get_wkb(),4000,1) from geotable c
    will get me the first 4000 byte of BLOB .
    When i using SQL as i did above,the max length is 4000, but i can get 32K using plsql as below:
    declare
    my_var CLOB;
    BEGIN
    for x in (Select X from T)
    loop
    my_var:=dbms_lob.substr(x.X,32767,1)
    end loop
    return my_var;
    I comfortably convert 32k BLOB field to string.
    My problem is how to convert blob to varchar having size more than 32K.
    Please help me to resolve this,
    Thanx in advance for the support,
    Nilesh

    Nilesh,
    . . . .The result of get_wkb() will not be human readable (all values are encoded into some binary format).
    SELECT utl_raw.cast_to_varchar2(tbl.geometry.get_wkt()) from FeatureTable tbl;
    -- resulting string:
        ☺AW(⌂özßHAA
    Å\(÷. . . .You may also want to have a look at { dbms_lob | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1015792 } "The DBMS_LOB package provides subprograms to operate on BLOBs, CLOBs, NCLOBs, BFILEs, and temporary LOBs."
    Regards,
    Noel

  • Function module to convert to time stamp format

    Hi friends,
    can you tell me any function module to convert date and time to time stamp format?
    kind regards.

    Just use 
    CONVERT DATE d
    TIME t [DAYLIGHT SAVING TIME dst]
    INTO TIME STAMP tst
    TIME ZONE tz.
    look at this example
    DATA:
    tstamp type timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    SET COUNTRY 'US'.
    CONVERT DATE d TIME t INTO
    TIME STAMP tstamp TIME ZONE 'UTC+12'.
    " tstamp : 19971224115500
    " (12/24/1997 11:55:00)
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO
    DATE d TIME t.
    Also look at the blog..
    /people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps
    Raja T
    Message was edited by:
            Raja Thangamani

  • Week returned by Format Date/time String

    Has anyone tested the Format Date/Time String function with the week formating codes?
    I want to create a subfolder for each week and name the folder accordingly. For 17 December 2003 the week is 51 in the year 03 but I get week 50. For 29 December 2003 the week is 01 in the year 04 but I get week 52. For 01 January 2004 the week is 01 in the year 04 but I get week 00. For 29 December 2004 the week is 53 in the year 04 but I get week 52. For 01 January 2005 the week is 53 in the year 04 but I get week 00. There is no difference using %U or %W as code (this will be if 1 January will fall on Sunday or Monday which it does not in my examples).
    I know normally a year has weeks 1 to 52 but in some years the last week may have week
    53 as in 2004. Adding 1 to the week does not solve the problem. For 29 December 2003 it would give 53. And 53 maybe a correct week as in 2004. For 1 January 2005 it would give 1 but the week is the week in the year before.
    All the week numbering I expect is correct for Germany but the function is not. Is the numbering from the function correct for your country?
    Please reply where you are located and if the function will work right for you.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

    I have found two resources about date and time and their formats.
    One is the ISO Standard 8601, the second is a german page. On this page along with other information all definitions used by Windows is listed.
    According to this page the ISO Standard has been established in Europe and most industrial countries. In USA it is ANSI X3.30-1985(R1991) and NIST FIPS 4-1.
    Since the ANSI definition you mentioned allows only Sunday (Jewish) or Monday (Christian) as first day of the week it ignores the Islamic world. For them the first day is Saturday. I could not gather information about Buddhistic or Hinduism
    based countries.
    For my application and the market aimed the ISO format is the one which will be choosen. Using %W and handling of week 0 should do it.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Converting string format of a number to numeric.

    Hi,
    I use the NumberFormat classes to convert a number to it's string formatted representation in the given locale. How do I achieve the opposite?
    I mean, how do I convert a String value of +"23,233,23"+ to an integer value 2323323?
    Thanks.

    I use the NumberFormat classes to convert a number to it's string formatted representation in the given locale. How do I achieve the opposite?Have a look at the parse() method of NumberFormat.
    ~

  • How to convert from military time (string) to regular time?

    How to convert from military time (string) to regular time?
    First of all I need to let you know I'm very new to Crystal Reports, so I apologize and will need detailed instructions if possible.
    I have created a Crystal Report pulling information from the received time field.  On the report, the time is showing in military time (ex. 16:00:00).
    How can I convert this time to normal time (ex. 4:00:00)
    Since the field is a 'String' field and not a 'Time' field, I do not have the option of changing it under the field properties.
    I hope someone can help with this.
    Thank you in advance.

    As my fields were date only and not datetime, I ended up using the following,
    If IsDate({CallLog.EmailRecdDate}) Then
         CDate({CallLog.EmailRecdDate})
    Else
         CDate(0,0,0)
    You answer lead me in the right direction.
    I'm still having an issue with the 'Else' statment returning 12:00:00 because of the CDate(0,0,0), but I'm not sure what else I can use to return a blank space on the report.  Any ideas?
    Thanks again!

Maybe you are looking for

  • What color space as base in a brand guide?

    What color space forms the base of a color brand guide? How do you start in terms of color spesifications? When I look at most guides it seems that Pantone is always the base, then CMYK, then RGB and Hex? Is RGB and Hex always gonna be a dithered ver

  • The System Preference:Desktop&Screensaver will not open. I get a rotating circle that never stop rotating. I have to do a Force Stop.

    The System Preference:Desktop&Screensaver will not open. I get a rotating circle that never stop rotating. I have to do a Force Stop.

  • Nullpointer in Application Connection Manager

    Hi All, when deploying an application I get the following exception. Has anybody else seen this? I'm somewhat lost at this point since other applications (e.g. ascontrol) deploy correctly. This occurs from a highly customized build and deployment env

  • Preview mode frozen

    I purchased my license for the trial version of PREL 8 yesterday and successfully completed my first project. All was well. For every subsequent project, however, the Preview window does not function. - I hear the audio, but the image does not move.

  • JDBC Response

    Hi. Being a beginner i had a query that What is the response structure of JDBC .. Normally JDBC have both Sync and Async as mode.. Thanks & Regards guna