Question: [snippet of The date format received](https://i.stack.imgur.com/23uhm.png) I want to display the date in an HTML table but unable to convert the iso8601 type date format to the date object.

```
$(document).ready(function(){

    var startDate;
    var formattedDate;
    var day;

    $(function(){
        $.ajax({
            url: "http://localhost:8080/employee/101",
            method: "Get",
            success: function(data,status){
                startDate = new Date(data.joinDate);
                day = startDate.dayOfWeek;
                console.log(startDate);
            }   
        });
    });

```

> 
> I get error : invalid date at "console.log(startDate);"
> 
> 
> 

I also need to increment the date but stuck at converting the iso8601 format to a normal date object.

Answer: 
I ran into the same issue when I was wanting to include a .ico file to use as the icon for my tkinter app. Here's how I got it to work:

1. When building the .exe file with PyInstaller, I specified the --add-data option with the full path to my .ico.
2. When the app starts up, it has to unpack everything from the .exe in a temp directory, so I get the path to that temp directory and use it to specify the temp location of my .ico file.

Before the mainloop is kicked off, and using 'tempfile' to get the temp file directory and 'glob' to check for a file pattern match:

```
tempdir = tempfile.gettempdir()
icon_path = tempdir + '\\' + 'next_subdirectory_pattern' + '\\' + '*.ico'
icon_matches = glob.glob(icon_path)
if len(icon_matches) > 0:
    logo = icon_matches[0]
else:
    logo = ''
tk.Tk.iconbitmap(self, default=logo)

```

Probably not the most eloquent way to do it, but it works.
In addition to accepted answer I want to add modified version:

```
from PIL import Image, ImageTk

from res import *
#res is a module with your base64 image string and in my case variable is icon_base64
from base64 import b64decode

pic_as_bytes=ImageTk.BytesIO(icon_base64)
my_image=Image.open(pic_as_bytes)

```

Please note this code will work in Python3, but could not in Python2 cause it needs differrent aproach and more conversions (the link below has exactly an example for Python2).

For more info please refer to <https://github.com/Ariel-MN/Tkinter_base64_Images/blob/master/tkinter_base64_image-ico.py>