Datetime picker with milliseconds (ion-datetime)

Hi everyone,

I have a time picker just like this:

        pickerFormat="HH mm ss"

How can I include milliseconds to this input?

My ionic info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2


    ios-deploy : 1.9.2
    Node       : v8.5.0
    npm        : 5.6.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:

    ANDROID_HOME : not set


    backend : pro

Since Ionic is using ISO 8601 format you will need todo a workaround.

I have never used milliseconds in my application before, but what I am reading out of the documentaion you could do it like this.


Now it should display milliseconds. (I hope so atleast :sweat_smile:)

Thanks for the quick response @cherry, but it doesn’t work.

This workaround only adds a duplicate of the seconds picker:

I am sorry then, I can’t help you much :disappointed_relieved:.

Maybe this link could be interesting for you!

Thank you.

I think I want to try to use masks in a simple ion-input component instead of use ion-datetime picker.

1 Like

Finally, I got this using Angular 2 Text Mask and simple ion-input.

Caution: Versions 8.0.3 and above of this library doesn’t work properly, so…

npm install angular2-text-mask@8.0.2 --save