{
"metadata": {
"name": "",
"signature": "sha256:bbbd486d20e7851cbefc2cd9d352354732ba5184d9a235eb50e6022152985218"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"IPython magic function documentation - `%date`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Installation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can install the magic function directly from my GitHub repository via:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%install_ext https://raw.githubusercontent.com/rasbt/python_reference/master/ipython_magic/datemagic.py"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Installed datemagic.py. To use it, type:\n",
" %load_ext datemagic\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Loading the `%date` magic"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To load the `date` magic, execute the following line in your IPython notebook or current IPython shell"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%load_ext datemagic"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Usage"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to display the available `magic` arguments, type:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%date?"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
%date [-d] [-t] [-s] [-p] [-i]\n", "\n", " \n", "IPython magic function for printing the current date, time, Python,\n", "and IPython version.\n", "\n", "optional arguments:\n", " -d, --date prints date (default)\n", " -t, --time print current time\n", " -s, --datetime print current time\n", " -p, --python prints Python version\n", " -i, --ipython prints IPython version\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "