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: 
Here's how I did it...

**To bundle the image with the executable:**

Use the following command to save your icon to a folder called "icon" that will be generated in the "C:\Users<username>\AppData\Local\Temp\_MEI123456" folder generated by pyinstaller at runtime:

```
--add-data=C:\absolute\path\to\your\ICON.ico;icon

```

My full command line, the string I type into the python terminal (i'm using pycharm IDE) to generate my EXE, looks like this:

```
pyinstaller -w -F -i=C:\absolute\path\to\your\ICON.ico --add-data=C:\absolute\path\to\your\ICON.ico;icon -n=MyEXEsNameV1 main.py

```

(For debug it is helpful to omit -w and add --debug=all)

*doc reference: <https://pyinstaller.readthedocs.io/en/stable/usage.html#options-group-what-to-bundle-where-to-search>*

**To access the image in my python script main.py:**

I used the following code to setup the tk window:

```
import tkinter as tk
from os import path

    # main widget
    self.root = tk.Tk(master)
    self.root.title('Window Title Bar Name V1.0')
    self.root.minsize(1234, 1234)

    # get icon
    try:
        # Get the absolute path of the temp directory
        path_to_icon = path.abspath(path.join(path.dirname(__file__), 'icon/GAUGE-ICON.ico')) 
        # set the icon of the tk window
        self.root.iconbitmap(path_to_icon)
    except:
        pass

```

*doc reference: <https://pyinstaller.readthedocs.io/en/stable/runtime-information.html>*
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>